Index: LayoutTests/http/tests/security/sandbox-iframe-allows-modals.html |
diff --git a/LayoutTests/http/tests/security/sandbox-iframe-allows-modals.html b/LayoutTests/http/tests/security/sandbox-iframe-allows-modals.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8a618fe09a77458f285980f10b6e8bac84e3196a |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/sandbox-iframe-allows-modals.html |
@@ -0,0 +1,31 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts allow-modals"> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+ <script> |
+ test(function () { |
+ var result = alert("Yay!"); |
+ assert_equals(result, undefined); |
+ }, "alert() returns synchronously in a sandboxed page without blocking on user input."); |
+ |
+ test(function () { |
+ var result = print(); |
+ assert_equals(result, undefined); |
+ }, "print() returns synchronously in a sandboxed page without blocking on user input."); |
+ |
+ test(function () { |
+ var result = confirm("Question?"); |
+ assert_equals(result, true); |
+ }, "confirm() returns 'true' in a sandboxed page (in our test environment)."); |
+ |
+ test(function () { |
+ var result = prompt("Question?"); |
+ assert_equals(result, null); |
+ }, "prompt() returns 'null' synchronously in a sandboxed page without blocking on user input."); |
+ </script> |
+</body> |
+</html> |