OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 if (window.testRunner) { |
| 3 testRunner.dumpAsText(); |
| 4 testRunner.waitUntilDone(); |
| 5 } |
| 6 |
| 7 window.onload = function () { |
| 8 var frame = document.querySelector('iframe'); |
| 9 frame.onload = test; |
| 10 frame.src = "http://localhost:8000/security/resources/cross-frame-iframe
-for-location-get-test.html"; |
| 11 }; |
| 12 |
| 13 function test() { |
| 14 var target = frames[0]; |
| 15 try { |
| 16 target.location.href; |
| 17 } catch (e) { |
| 18 console.log('target.location.href threw exception of type ' + e.name
); |
| 19 } |
| 20 |
| 21 try { |
| 22 document.getElementById('output').innerText = 'First.'; |
| 23 } catch (e) { |
| 24 console.log('First document.getElementById.innerText threw exception
of type ' + e.name); |
| 25 } |
| 26 |
| 27 try { |
| 28 document.getElementById('output').innerText += 'Second.'; |
| 29 } catch (e) { |
| 30 console.log('Second document.getElementById.innerText threw exceptio
n of type ' + e.name); |
| 31 } |
| 32 |
| 33 if (window.testRunner) |
| 34 testRunner.notifyDone(); |
| 35 } |
| 36 </script> |
| 37 <iframe></iframe> |
| 38 <pre id="output"></pre> |
OLD | NEW |