| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 iframe { width: 400px; height: 200px;} | 4 iframe { width: 400px; height: 200px;} |
| 5 </style> | 5 </style> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 6 <script> | 8 <script> |
| 7 if (window.testRunner) { | 9 if (window.testRunner) { |
| 8 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 9 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
| 10 } | 12 } |
| 11 | 13 |
| 12 function loaded() | 14 function loaded() |
| 13 { | 15 { |
| 14 document.getElementsByTagName('h4')[0].innerHTML = document.domain; | 16 document.getElementsByTagName('h4')[0].innerHTML = document.domain; |
| 15 var iframe = document.getElementById("i"); | 17 var iframe = document.getElementById("i"); |
| 16 // The iframe uses eventSender to emulate a user navigatation, which
requires absolute coordinates. | 18 // The iframe uses eventSender to emulate a user navigatation, which
requires absolute coordinates. |
| 17 // Because the iframe is cross-origin, it can't get the offsets itse
lf, so leak them. | 19 // Because the iframe is cross-origin, it can't get the offsets itse
lf, so leak them. |
| 18 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); | 20 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); |
| 19 } | 21 } |
| 22 test(function() { |
| 23 window.addEventListener("message", e => { |
| 24 assert_equals(e.data, "PASS", "The message says 'PASS' instead of
'FAIL'"); |
| 25 }); |
| 26 }, "The sandboxed iframe posted a message saying the test was in the sta
te of 'PASS'."); |
| 20 </script> | 27 </script> |
| 21 </head> | 28 </head> |
| 22 <body onload="loaded();"> | 29 <body onload="loaded();"> |
| 23 <p>This tests that an iframe in sandbox with 'allow-top-navigation-with-user
-activation' | 30 <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-a
ctivation' |
| 24 can navigate the top level page, if it is trigged by a user gesture.</p> | 31 can navigate the top level page, if it is trigged by a user gesture.</p> |
| 25 <h4>DOMAIN</h4> | 32 <h4>DOMAIN</h4> |
| 26 <iframe id="i" sandbox="allow-scripts allow-top-navigation-with-user-activat
ion" src="http://localhost:8000/security/frameNavigation/resources/iframe-that-p
erforms-parent-navigation.html"></iframe> | 33 <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activatio
n" src="resources/iframe-that-performs-parent-navigation.html"></iframe> |
| 27 </body> | 34 </body> |
| 28 </html> | 35 </html> |
| OLD | NEW |