Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html

Issue 1126253007: Block modal dialogs inside sandboxes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebSandboxFlags. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html
diff --git a/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html b/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html
new file mode 100644
index 0000000000000000000000000000000000000000..242190c58e1edcef05e13014d3fb2b5e05ac6ca5
--- /dev/null
+++ b/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts">
+ <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, false);
+ }, "confirm() returns 'false' synchronously in a sandboxed page without blocking on user input.");
+
+ 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>

Powered by Google App Engine
This is Rietveld 408576698