4 <script src="../../../resources/js-test.js"></script>
5 <iframe id="childFrame" src="./resources/shadow-tree-listener-clearance-frame.html"></iframe>
8 var child = document.getElementById("childFrame");
11 function getChildTarget()
13 return child.contentDocument.targetInShadow;
18 var toBeListened = getChildTarget();
19 toBeListened.addEventListener("test", function(event) { firedCount++; });
21 toBeListened.dispatchEvent(new CustomEvent("test"));
22 shouldBe("firedCount", "1");
24 window.child.contentDocument.open(); // This should clear event listeners
25 toBeListened.dispatchEvent(new CustomEvent("test"));
26 shouldBe("firedCount", "1");
27 window.child.contentDocument.close();
33 child.addEventListener("load", test);