OLD | NEW |
1 <html> | 1 <html> |
2 <body onload="startTest()"> | 2 <body onload="startTest()"> |
3 | 3 |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 description("This test checks that moving an element with an event handler from
one window (FrameHost) to another properly migrates the handler too."); | 7 description("This test checks that moving an element with an event handler from
one window (FrameHost) to another properly migrates the handler too."); |
8 | 8 |
9 var jsTestIsAsync = true; | 9 var jsTestIsAsync = true; |
10 var window2; | 10 var window2; |
11 | 11 |
12 function window2Loaded() { | 12 function window2Loaded() { |
13 shouldBe('window.internals.scrollEventHandlerCount(document)', '0'); | 13 shouldBe('window.internals.scrollEventHandlerCount(document)', '0'); |
14 var div = window2.document.getElementById("div"); | 14 var div = window2.document.getElementById("div"); |
15 window.document.adoptNode(div); | 15 window.document.adoptNode(div); |
16 window.document.body.appendChild(div); | 16 window.document.body.appendChild(div); |
17 shouldBe('window.internals.scrollEventHandlerCount(document)', '1'); | 17 shouldBe('window.internals.scrollEventHandlerCount(document)', '1'); |
18 | 18 |
19 window2.close(); | 19 window2.close(); |
20 finishJSTest(); | 20 finishJSTest(); |
21 } | 21 } |
22 | 22 |
23 function startTest() { | 23 function startTest() { |
24 if (window.testRunner) { | 24 if (window.testRunner) { |
25 testRunner.waitUntilDone(); | 25 testRunner.waitUntilDone(); |
26 testRunner.setCanOpenWindows(); | 26 testRunner.setCanOpenWindows(); |
27 } | 27 } |
28 window2 = window.open('data:text/html,<div id="div" onscroll="function() {}"
></div>'); | 28 window2 = window.open('resources/move-event-handler-between-framehosts-popup
.html'); |
29 window2.addEventListener("load", window2Loaded, false); | 29 window2.addEventListener("load", window2Loaded, false); |
30 } | 30 } |
31 | 31 |
32 </script> | 32 </script> |
33 | 33 |
34 </body> | 34 </body> |
35 </html> | 35 </html> |
OLD | NEW |