Index: LayoutTests/fast/events/move-event-handler-between-framehosts.html |
diff --git a/LayoutTests/fast/events/move-event-handler-between-framehosts.html b/LayoutTests/fast/events/move-event-handler-between-framehosts.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..579fea029028aacf87dbd8a4bb42188d97309e21 |
--- /dev/null |
+++ b/LayoutTests/fast/events/move-event-handler-between-framehosts.html |
@@ -0,0 +1,35 @@ |
+<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('data:text/html,<div id="div" onscroll="function() {}"></div>'); |
+ window2.addEventListener("load", window2Loaded, false); |
+} |
+ |
+</script> |
+ |
+</body> |
+</html> |