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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.php

Issue 2448833003: Sandbox should prevent 'execCommand("print", ...)'. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698