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

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

Issue 679863002: Revert "Prepare blink to unify definitions of load completion" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
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();
28 27
29 finishJSTest(); 28 finishJSTest();
30 } 29 }
31 30
32 jsTestIsAsync = true; 31 jsTestIsAsync = true;
33 child.addEventListener("load", test); 32 child.addEventListener("load", test);
34 33
35 </script> 34 </script>
36 </body> 35 </body>
37 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698