OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 function performTest() | 4 function performTest() |
5 { | 5 { |
6 try { | 6 try { |
7 top.location = "navigation-changed-iframe.html"; | 7 top.location = "navigation-changed-iframe.html"; |
8 } catch(e) { | 8 } catch(e) { |
9 top.postMessage("BLOCKED", "*"); | 9 top.postMessage("BLOCKED", "*"); |
10 } | 10 } |
11 } | 11 } |
12 </script> | 12 </script> |
13 </head> | 13 </head> |
14 <body onload="performTest();"> | 14 <body onload="performTest();"> |
15 <p>This doc tried to navigate the top page when loaded, which should fail si
nce it's not trigged by user activation while in a sandboxed frame with 'allow-t
op-navigtaion-by-user-activation'. <br> <br> | 15 <p>This doc tried to navigate the top page when loaded, which should fail si
nce it's not trigged by user activation while in a sandboxed frame with 'allow-t
op-navigtaion-by-user-activation'. <br> <br> |
16 If you click the button below, the top navigation should succeed with the ne
w page saying "PASSED: Navigation succeeded.". | 16 Click the button below, the top navigation should succeed with a new page sa
ying "PASSED: Navigation succeeded." in browsers supporting the 'allow-top-navig
taion-by-user-activation' iframe@sandbox keyword (eg., Chrome v58+); Otherwise,
the top navigation should fail. |
17 </p> | 17 </p> |
18 <button id="b" onclick="performTest();">Navigate the top page</button> | 18 <button id="b" onclick="performTest();">Navigate the top page</button> |
19 </body> | 19 </body> |
20 </html> | 20 </html> |
OLD | NEW |