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

Side by Side Diff: LayoutTests/fast/dom/shadow/shadow-tree-listener-clearance.html

Issue 561813003: Prepare blink to unify definitions of load completion (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add document.close() to scroll-left-while-loading.html Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <iframe id="childFrame" src="./resources/shadow-tree-listener-clearance-frame.ht ml"></iframe> 5 <iframe id="childFrame" src="./resources/shadow-tree-listener-clearance-frame.ht ml"></iframe>
6 <script> 6 <script>
7 7
8 var child = document.getElementById("childFrame"); 8 var child = document.getElementById("childFrame");
9 var firedCount = 0; 9 var firedCount = 0;
10 10
11 function getChildTarget() 11 function getChildTarget()
12 { 12 {
13 return child.contentDocument.targetInShadow; 13 return child.contentDocument.targetInShadow;
14 } 14 }
15 15
16 function test() 16 function test()
17 { 17 {
18 var toBeListened = getChildTarget(); 18 var toBeListened = getChildTarget();
19 toBeListened.addEventListener("test", function(event) { firedCount++; }); 19 toBeListened.addEventListener("test", function(event) { firedCount++; });
20 20
21 toBeListened.dispatchEvent(new CustomEvent("test")); 21 toBeListened.dispatchEvent(new CustomEvent("test"));
22 shouldBe("firedCount", "1"); 22 shouldBe("firedCount", "1");
23 23
24 window.child.contentDocument.open(); // This should clear event listeners 24 window.child.contentDocument.open(); // This should clear event listeners
25 toBeListened.dispatchEvent(new CustomEvent("test")); 25 toBeListened.dispatchEvent(new CustomEvent("test"));
26 shouldBe("firedCount", "1"); 26 shouldBe("firedCount", "1");
27 window.child.contentDocument.close();
27 28
28 finishJSTest(); 29 finishJSTest();
29 } 30 }
30 31
31 jsTestIsAsync = true; 32 jsTestIsAsync = true;
32 child.addEventListener("load", test); 33 child.addEventListener("load", test);
33 34
34 </script> 35 </script>
35 </body> 36 </body>
36 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698