| OLD | NEW |
| 1 <!doctype html> |
| 1 <html> | 2 <html> |
| 2 <head> | 3 <head> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 3 <script> | 6 <script> |
| 4 if (window.testRunner) { | 7 async_test(function(t) { |
| 5 testRunner.dumpAsText(); | 8 window.addEventListener("message", t.step_func_done(function(e) { |
| 6 testRunner.dumpChildFramesAsText(); | 9 assert_equals(e.data, "PASS", "The message should say 'PASS' instead of 'F
AIL'"); |
| 7 testRunner.setDumpConsoleMessages(false); | 10 })); |
| 8 testRunner.waitUntilDone(); | 11 }, "The sandboxed iframe should post a message saying the test was in the state
of 'PASS'."); |
| 9 } | |
| 10 | |
| 11 window.addEventListener("message", e => { | |
| 12 if (e.data == "PASS") | |
| 13 testRunner.notifyDone(); | |
| 14 else | |
| 15 testRunner.testFailed("'top.location' didn't throw."); | |
| 16 }); | |
| 17 </script> | 12 </script> |
| 18 </head> | 13 </head> |
| 19 <body> | 14 <body> |
| 20 <p>This tests that an iframe in sandbox with 'allow-top-navigation-with-user
-activation' | 15 <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-a
ctivation' |
| 21 cannot navigate its top level page, if it is not trigged by a user gesture.<
/p> | 16 cannot navigate its top level page, if it is not trigged by a user gesture.<
/p> |
| 22 <iframe sandbox='allow-top-navigation-with-user-activation allow-scripts' sr
c="http://localhost:8000/security/frameNavigation/resources/iframe-that-performs
-top-navigation-without-user-gesture-failed.html"></iframe> | 17 <iframe sandbox='allow-top-navigation-by-user-activation allow-scripts' src=
"resources/iframe-that-performs-top-navigation-without-user-gesture-failed.html"
></iframe> |
| 23 </body> | 18 </body> |
| 24 </html> | 19 </html> |
| OLD | NEW |