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

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: fix tests 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 frameDocs = [];
9 var docsLoaded = 0;
10 var numFrames = 3;
11
12 function startTest() {
13 if (++docsLoaded < numFrames)
14 return;
15
16 debug("Loaded all frames.");
17
18 frameDocs.push(window[0].document);
19 frameDocs.push(window[0][0].document);
20 frameDocs.push(window[0][1].document);
21
22 for (var i = 0; i < frameDocs.length; ++i) {
23 frameDocs[i].addEventListener(
24 "visibilitychange",
25 onVisibilityChange.bind(null, i), false);
26 }
27
28 document.body.removeChild(document.getElementById("frame1"));
29
30 finishJSTest();
31 }
32
33 function onVisibilityChange(i) {
34 shouldBe('frameDocs[' + i + '].visibilityState', '"hidden"');
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