Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / page-visibility-iframe-delete-test.html
blob335b243e4811a28d0151f7b5a2d5401981d4c411
1 <html>
2 <body onload="startTest()">
4 <script src="../../resources/js-test.js"></script>
6 <script>
8 description("This test checks that the page visibility event propagation does not crash the browser when frames are added / deleted.");
10 var jsTestIsAsync = true;
12 var frame1, frame2, frame3, frame4, frame5, subframe1, subFrame2, subFrame3;
14 var docsLoaded = 0;
16 function startTest() {
17 ++docsLoaded;
18 if (docsLoaded < 8) {
19 return;
22 debug("Loaded all frames.");
24 frame1 = document.getElementById("topFrame1");
25 frame2 = document.getElementById("topFrame2");
26 frame3 = document.getElementById("topFrame3");
27 frame4 = document.getElementById("topFrame4");
28 subFrame1 = frame3.contentDocument.getElementById("subIframe1");
29 subFrame2 = frame3.contentDocument.getElementById("subIframe2");
31 document.addEventListener(
32 "visibilitychange", onMainPageVisibilityChange, false);
33 frame2.contentDocument.addEventListener(
34 "visibilitychange", onFrame2VisibilityChange, false);
35 // Change the visibility of the current page to invisible.
36 if (window.testRunner)
37 testRunner.setPageVisibility("hidden");
38 finishJSTest();
41 function onMainPageVisibilityChange() {
42 debug("Visibility of main document changed.");
43 // Delete frame 4.
44 document.body.removeChild(frame4);
46 // Delete subframe 2.
47 frame3.contentDocument.body.removeChild(subFrame2);
49 // Add a new frame to top level.
50 frame5 = document.createElement("iframe");
51 frame5.src = '';
52 document.body.appendChild(frame5);
54 // Add a new frame to frame2.
55 subFrame3 = frame2.contentDocument.createElement("iframe");
56 subFrame3.src = '';
57 frame2.contentDocument.body.appendChild(subFrame3);
60 function onFrame2VisibilityChange() {
61 debug("Visibility of sub frame 2 changed.");
62 // Delete frame 1.
63 document.body.removeChild(frame1);
66 </script>
69 <iframe id="topFrame1" onload="startTest()" ></iframe>
70 <iframe id="topFrame2" onload="startTest()" ></iframe>
71 <iframe id="topFrame3" onload="startTest()" src="resources/page-visibility-iframe-delete-test-frame.html"></iframe>
72 <iframe id="topFrame4" onload="startTest()" ></iframe>
73 </body>
74 </html>