OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../resources/cross-frame-access.js"></script> | 3 <script src="../../resources/cross-frame-access.js"></script> |
4 <script> | 4 <script> |
5 window.onload = function() | 5 window.onload = function() |
6 { | 6 { |
7 document.getElementsByTagName('h4')[0].innerHTML = document.domain; | 7 document.getElementsByTagName('h4')[0].innerHTML = document.domain; |
8 if (window.testRunner) { | 8 window.addEventListener('message', runTest); |
9 setTimeout(pollForTest, 1); | |
10 } else { | |
11 log("Click the link to run the test."); | |
12 } | |
13 } | |
14 | |
15 pollForTest = function() | |
16 { | |
17 if (!testRunner.globalFlag) { | |
18 setTimeout(pollForTest, 1); | |
19 return; | |
20 } | |
21 runTest(); | |
22 } | 9 } |
23 | 10 |
24 runTest = function() | 11 runTest = function() |
25 { | 12 { |
26 if (!window.testRunner) | 13 if (!window.testRunner) |
27 return; | 14 return; |
28 | 15 |
29 var event = document.createEvent('MouseEvent'); | 16 var event = document.createEvent('MouseEvent'); |
30 event.initEvent( 'click', true, true ); | 17 event.initEvent( 'click', true, true ); |
31 document.getElementById('anchorLink').dispatchEvent(event); | 18 document.getElementById('anchorLink').dispatchEvent(event); |
(...skipping 18 matching lines...) Expand all Loading... |
50 } | 37 } |
51 </script> | 38 </script> |
52 </head> | 39 </head> |
53 <body> | 40 <body> |
54 <h3>Frame-with-link-to-navigate</h3> | 41 <h3>Frame-with-link-to-navigate</h3> |
55 <h4>DOMAIN</h4> | 42 <h4>DOMAIN</h4> |
56 <pre id='console'></pre> | 43 <pre id='console'></pre> |
57 <a id="anchorLink" href="navigation-happened.html" target="toNavigate">Click
me</a> | 44 <a id="anchorLink" href="navigation-happened.html" target="toNavigate">Click
me</a> |
58 </body> | 45 </body> |
59 </html> | 46 </html> |
OLD | NEW |