Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="/resources/testharness.js"></script> | |
| 3 <script src="/resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 async_test(t => { | |
| 6 window.addEventListener("message", t.step_func_done(e => { | |
| 7 assert_equals(e.data.name, 'SecurityError', 'Should throw a security error.'); | |
| 8 assert_equals(e.data.location, 'about:srcdoc', 'Exception is same-or igin with the embedee.'); | |
| 9 })); | |
| 10 }, "Sandboxed frames should throw when navigating the top-level window."); | |
| 11 </script> | |
| 12 <iframe sandbox="allow-scripts" | |
| 13 srcdoc="<script> | |
| 14 try { | |
| 15 top.location = '/security/frameNavigation/resources/fail.htm l'; | |
| 16 top.postMessage('No Exception', '*'); | |
| 17 } catch (e) { | |
| 18 top.postMessage({ | |
| 19 'name': e.name, | |
| 20 'location': e.constructor.constructor('return location.hre f')() | |
|
Mike West
2016/09/28 12:26:13
Jochen: Does this (and the assertion on #8) addres
| |
| 21 }, '*'); | |
| 22 } | |
| 23 </script>"></iframe> | |
| OLD | NEW |