OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 window.jsTestIsAsync = true; | 6 window.jsTestIsAsync = true; |
7 | 7 |
8 var allowedExecuted = 0; | 8 var allowedExecuted = 0; |
9 var disallowedExecuted = 0; | 9 var disallowedExecuted = 0; |
10 window.addEventListener('message', function () { | 10 window.addEventListener('message', function () { |
11 disallowedExecuted++; | 11 disallowedExecuted++; |
12 | 12 |
13 finish(); | 13 finish(); |
14 }); | 14 }); |
15 | 15 |
16 function finish() { | 16 function finish() { |
17 shouldBe("disallowedExecuted", "0"); | 17 shouldBe("disallowedExecuted", "0"); |
18 shouldBe("allowedExecuted", "0"); | 18 shouldBe("allowedExecuted", "0"); |
19 | 19 |
20 finishJSTest(); | 20 finishJSTest(); |
21 }; | 21 }; |
22 </script> | 22 </script> |
23 <script src="../js/resources/js-test-post.js"></script> | |
24 </head> | 23 </head> |
25 <body> | 24 <body> |
26 <iframe sandbox="allow-same-origin" | 25 <iframe sandbox="allow-same-origin" |
27 onload="finish()" | 26 onload="finish()" |
28 src="data:text/html,<script>alert('FAIL: Executed script without all
ow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script
>"> | 27 src="data:text/html,<script>alert('FAIL: Executed script without all
ow-scripts in data URL');window.parent.postMessage({'fail': true}, '*');</script
>"> |
29 </iframe> | 28 </iframe> |
30 <script> | 29 <script> |
31 description("Verify that sandboxed frames without sandbox='allow-scripts
' cannot execute script from data: URLs."); | 30 description("Verify that sandboxed frames without sandbox='allow-scripts
' cannot execute script from data: URLs."); |
32 </script> | 31 </script> |
33 </body> | 32 </body> |
34 </html> | 33 </html> |
35 | 34 |
36 | 35 |
37 | 36 |
38 | 37 |
OLD | NEW |