OLD | NEW |
1 <?php | 1 <?php |
2 header("Content-Security-Policy: sandbox allow-scripts"); | 2 header("Content-Security-Policy: sandbox allow-scripts"); |
3 ?> | 3 ?> |
4 <!DOCTYPE html> | 4 <!DOCTYPE html> |
5 <html> | 5 <html> |
6 <head> | 6 <head> |
7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
11 <script> | 11 <script> |
12 test(function () { | 12 test(function () { |
13 var result = alert("Yay!"); | 13 var result = alert("Yay!"); |
14 assert_equals(result, undefined); | 14 assert_equals(result, undefined); |
15 }, "alert() returns synchronously in a sandboxed page without blocking o
n user input."); | 15 }, "alert() returns synchronously in a sandboxed page without blocking o
n user input."); |
16 | 16 |
17 test(function () { | 17 test(function () { |
18 var result = print(); | 18 var result = print(); |
19 assert_equals(result, undefined); | 19 assert_equals(result, undefined); |
20 }, "print() returns synchronously in a sandboxed page without blocking o
n user input."); | 20 }, "print() returns synchronously in a sandboxed page without blocking o
n user input."); |
21 | 21 |
22 test(function () { | 22 test(function () { |
| 23 var result = document.execCommand('print', false, null); |
| 24 assert_false(result); |
| 25 }, "execCommand('print', ...) returns synchronously in a sandboxed page
without blocking on user input."); |
| 26 |
| 27 test(function () { |
23 var result = confirm("Question?"); | 28 var result = confirm("Question?"); |
24 assert_equals(result, false); | 29 assert_equals(result, false); |
25 }, "confirm() returns 'false' synchronously in a sandboxed page without
blocking on user input."); | 30 }, "confirm() returns 'false' synchronously in a sandboxed page without
blocking on user input."); |
26 | 31 |
27 test(function () { | 32 test(function () { |
28 var result = prompt("Question?"); | 33 var result = prompt("Question?"); |
29 assert_equals(result, null); | 34 assert_equals(result, null); |
30 }, "prompt() returns 'null' synchronously in a sandboxed page without bl
ocking on user input."); | 35 }, "prompt() returns 'null' synchronously in a sandboxed page without bl
ocking on user input."); |
31 </script> | 36 </script> |
32 </body> | 37 </body> |
33 </html> | 38 </html> |
OLD | NEW |