blob: 0497fc837abdb359f470d8531bb6e651941c9eb2 [file] [log] [blame]
<html>
<body onload="startTest()">
<script src="../../resources/js-test.js"></script>
<script>
description("This test checks that moving an element with an event handler from one window (FrameHost) to another properly migrates the handler too.");
var jsTestIsAsync = true;
var window2;
function window2Loaded() {
shouldBe('window.internals.scrollEventHandlerCount(document)', '0');
var div = window2.document.getElementById("div");
window.document.adoptNode(div);
window.document.body.appendChild(div);
shouldBe('window.internals.scrollEventHandlerCount(document)', '1');
window2.close();
finishJSTest();
}
function startTest() {
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
}
window2 = window.open('resources/move-event-handler-between-framehosts-popup.html');
window2.addEventListener("load", window2Loaded, false);
}
</script>
</body>
</html>