Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / page-visibility-crash.html
blobf29379b858b1673aa0c078c117f21f62e6fd1e40
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script>
5 if (window.testRunner) {
6 window.testRunner.dumpAsText();
7 window.testRunner.waitUntilDone();
10 function finish() {
11 document.open();
12 document.write("PASS. WebKit didn't crash");
13 document.close();
15 if (window.testRunner)
16 testRunner.notifyDone();
19 function crash()
21 document.body.removeChild(document.getElementById("f"));
22 setTimeout("finish()", 0);
25 frame = document.createElement("iframe");
26 frame.id = "f";
27 document.body.appendChild(frame);
28 scriptElement = frame.contentDocument.createElement("script");
29 frame.contentDocument.body.appendChild(scriptElement);
30 scriptElement.innerText = "function handleVisibilityChange() \
31 { \
32 parent.crash(); \
33 } \
34 document.addEventListener('visibilitychange', handleVisibilityChange, false);";
36 if (window.testRunner)
37 testRunner.setPageVisibility("hidden");
39 // Many platforms don't support the page visibility api. For those, just bail out.
40 setTimeout("finish()", 10);
41 </script>
42 </body>
43 </html>