Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-unload.html

Issue 1778753003: Fire visibilitychange event on unload (behind the flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <body>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 description("This test checks that the page visibility event is fired when frame is unloaded.");
6
7 var jsTestIsAsync = true;
8 var frames = [];
9 var docsLoaded = 0, visibilityChanged = 0;
10 var numFrames = 3;
11
12 function startTest() {
13 if (++docsLoaded < numFrames)
14 return;
15
16 debug("Loaded all frames.");
17
18 frames.push(document.getElementById("frame1"));
19 frames.push(frame1.contentDocument.getElementById("subIframe1"));
20 frames.push(frame1.contentDocument.getElementById("subIframe2"));
21
22 for (var i = 0; i < frames.length; ++i) {
23 frames[i].contentDocument.addEventListener(
24 "visibilitychange",
25 onVisibilityChange.bind(null, i), false);
26 }
27
28 document.body.removeChild(frames[0]);
29 }
30
31 function onVisibilityChange(i) {
32 shouldBe('frames[' + i + '].contentDocument.visibilityState', '"hidden"');
33 if (++visibilityChanged == numFrames)
34 finishJSTest();
35 }
36
37 </script>
38 <iframe id="frame1" src="resources/page-visibility-iframe-with-subframes.html">< /iframe>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698