OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 if (window.testRunner) { | 4 if (window.testRunner) { |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
6 testRunner.setCanOpenWindows(); | 6 testRunner.setCanOpenWindows(); |
7 testRunner.dumpChildFramesAsText(); | 7 testRunner.dumpChildFramesAsText(); |
8 testRunner.waitUntilDone(); | 8 testRunner.waitUntilDone(); |
9 testRunner.setCloseRemainingWindowsWhenComplete() | 9 testRunner.setCloseRemainingWindowsWhenComplete() |
10 testRunner.setPopupBlockingEnabled(true); | 10 testRunner.setPopupBlockingEnabled(true); |
11 } | 11 } |
12 | 12 |
13 function test() | 13 function test() |
14 { | 14 { |
15 var myLink = document.getElementById('link'); | 15 var myLink = document.getElementById('link'); |
16 var myFrame = document.getElementById('otherFrame').contentWindow; | 16 var myFrame = window.frames['otherFrame']; |
17 myLink.onclick = myFrame.handleClick; | 17 myLink.onclick = myFrame.handleClick; |
18 if (window.testRunner) { | 18 if (window.testRunner) { |
19 var x = myLink.offsetLeft + 2; | 19 var x = myLink.offsetLeft + 2; |
20 var y = myLink.offsetTop + 2; | 20 var y = myLink.offsetTop + 2; |
21 eventSender.mouseMoveTo(x, y); | 21 eventSender.mouseMoveTo(x, y); |
22 eventSender.mouseDown(); | 22 eventSender.mouseDown(); |
23 eventSender.mouseUp(); | 23 eventSender.mouseUp(); |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 function log(msg) | 27 function log(msg) |
28 { | 28 { |
29 var res = document.getElementById('res'); | 29 var res = document.getElementById('res'); |
30 res.innerHTML = res.innerHTML + msg + "<br>"; | 30 res.innerHTML = res.innerHTML + msg + "<br>"; |
31 } | 31 } |
32 </script> | 32 </script> |
33 </head> | 33 </head> |
34 <body onload="test()"> | 34 <body onload="test()"> |
35 This tests that window.open works across frames.<br> | 35 This tests that window.open works across frames.<br> |
36 To run manually click the link below.<br> | 36 To run manually click the link below.<br> |
37 <a href="resources/greenbox.png" id="link">GreenBox or Success page.</a>
<br> | 37 <a href="resources/greenbox.png" id="link">GreenBox or Success page.</a>
<br> |
38 <iframe src="resources/open-window-from-another-frame-otherFrame.html" i
d="otherFrame"></iframe> | 38 <iframe src="resources/open-window-from-another-frame-otherFrame.html" n
ame="otherFrame"></iframe> |
39 <div id="res"></div> | 39 <div id="res"></div> |
40 </body> | 40 </body> |
41 </html> | 41 </html> |
OLD | NEW |