Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / sandbox-iframe-allows-modals.html
blob8a618fe09a77458f285980f10b6e8bac84e3196a
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts allow-modals">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 test(function () {
11 var result = alert("Yay!");
12 assert_equals(result, undefined);
13 }, "alert() returns synchronously in a sandboxed page without blocking on user input.");
15 test(function () {
16 var result = print();
17 assert_equals(result, undefined);
18 }, "print() returns synchronously in a sandboxed page without blocking on user input.");
20 test(function () {
21 var result = confirm("Question?");
22 assert_equals(result, true);
23 }, "confirm() returns 'true' in a sandboxed page (in our test environment).");
25 test(function () {
26 var result = prompt("Question?");
27 assert_equals(result, null);
28 }, "prompt() returns 'null' synchronously in a sandboxed page without blocking on user input.");
29 </script>
30 </body>
31 </html>