| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="cross-frame-access.js"></script> | 3 <script src="cross-frame-access.js"></script> |
| 4 <script> | 4 <script> |
| 5 function loaded() | 5 function loaded() |
| 6 { | 6 { |
| 7 if (window.testRunner) { | 7 window.addEventListener('message', performTest); |
| 8 function waitForFlag() { | |
| 9 if (!testRunner.globalFlag) { | |
| 10 setTimeout(waitForFlag, 1); | |
| 11 return; | |
| 12 } | |
| 13 performTest(); | |
| 14 } | |
| 15 setTimeout(waitForFlag, 1); | |
| 16 } else { | |
| 17 log("Click the button when all the subframes have finished loadi
ng."); | |
| 18 } | |
| 19 } | 8 } |
| 20 | 9 |
| 21 function performTest() | 10 function performTest() |
| 22 { | 11 { |
| 23 try { | 12 try { |
| 24 window.parent.frames[0].document.getElementById('accessMe').inne
rHTML = "PASS: Host name compare is case insensitive."; | 13 window.parent.frames[0].document.getElementById('accessMe').inne
rHTML = "PASS: Host name compare is case insensitive."; |
| 25 } catch (e) { | 14 } catch (e) { |
| 26 log("FAIL: An error occurred during testing.") | 15 log("FAIL: An error occurred during testing.") |
| 27 } | 16 } |
| 28 | 17 |
| 29 if (window.testRunner) | 18 if (window.testRunner) |
| 30 testRunner.notifyDone(); | 19 testRunner.notifyDone(); |
| 31 } | 20 } |
| 32 </script> | 21 </script> |
| 33 </head> | 22 </head> |
| 34 <body onload="loaded();"> | 23 <body onload="loaded();"> |
| 35 <p>Other inner iframe.</p> | 24 <p>Other inner iframe.</p> |
| 36 <button onclick="performTest();">Test</button> | |
| 37 <pre id='console'></pre> | 25 <pre id='console'></pre> |
| 38 </body> | 26 </body> |
| 39 </html> | 27 </html> |
| OLD | NEW |