| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 <body> |
| 5 <script> |
| 6 async_test(t => { |
| 7 var i = document.createElement('iframe'); |
| 8 i.sandbox = "allow-scripts allow-same-origin allow-modals"; |
| 9 i.srcdoc = "<script>" + |
| 10 " window.onerror = (m,f,l,c,e) => { top.postMessage(e.name,
'*'); }" + |
| 11 "</scr" + "ipt>" + |
| 12 "<a href='javascript:top.location=\"/security/frameNavigation
/resources/fail.html\";'>click</a>"; |
| 13 |
| 14 window.onmessage = t.step_func_done(e => { |
| 15 assert_equals(e.data, "SecurityError", "The 'javascript:' navigation
threw."); |
| 16 assert_equals(i.contentDocument.body.innerText, "click", "The page c
ontents did not change."); |
| 17 }); |
| 18 |
| 19 var clicked = false; |
| 20 i.onload = t.step_func(e => { |
| 21 i.contentDocument.querySelector('a').click(); |
| 22 clicked = true; |
| 23 }); |
| 24 |
| 25 document.body.appendChild(i); |
| 26 }, "Sandboxed frames should throw when navigating the top-level window."); |
| 27 </script> |
| 28 </body> |
| OLD | NEW |