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

Side by Side Diff: LayoutTests/fast/frames/sandboxed-iframe-parsing-space-characters.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 This tests whether we correct parse various space characters in the sandbox attr ibute.<br> 1 This tests whether we correct parse various space characters in the sandbox attr ibute.<br>
2 <script> 2 <script>
3 var testCases = [ 3 var testCases = [
4 [' ', 'PASS: Space is a delimiter character.'], 4 [' ', 'PASS: Space is a delimiter character.'],
5 ['\t', 'PASS: Tab is a delimiter.'], 5 ['\t', 'PASS: Tab is a delimiter.'],
6 ['x', 'FAIL: x is not a delimiter.'], 6 ['x', 'FAIL: x is not a delimiter.'],
7 ['\r', 'PASS: Return is a delimiter.'], 7 ['\r', 'PASS: Return is a delimiter.'],
8 ['\n', 'PASS: Newline is a delimiter.'], 8 ['\n', 'PASS: Newline is a delimiter.'],
9 ['\v', 'FAIL: Vertical tab is not a delimiter.'], 9 ['\v', 'FAIL: Vertical tab is not a delimiter.'],
10 ['\f', 'PASS: Form feed is a delimiter.'], 10 ['\f', 'PASS: Form feed is a delimiter.'],
11 ] 11 ]
12 12
13 function next() { 13 function next() {
14 if (testCases.length) { 14 if (testCases.length) {
15 var testCase = testCases.pop(); 15 var testCase = testCases.pop();
16 testCharacter.apply(null, testCase); 16 testCharacter.apply(null, testCase);
17 return; 17 return;
18 } 18 }
19 19
20 if (window.testRunner) 20 if (window.testRunner)
21 testRunner.notifyDone(); 21 testRunner.notifyDone();
22 } 22 }
23 23
24 function testCharacter(possibleDelimiter, message) { 24 function testCharacter(possibleDelimiter, message) {
25 var policy = "allow-scripts" + possibleDelimiter + "allow-forms"; 25 var policy = "allow-scripts" + possibleDelimiter + "allow-forms";
26 var iframe = document.createElement('iframe'); 26 var iframe = document.createElement('iframe');
27 iframe.sandbox = policy; 27 iframe.sandbox = policy;
28 iframe.src = "data:text/html,<script>alert('" + message + "');<\/script>"; 28 iframe.src = "data:text/html,<script>console.log('" + message + "');<\/scrip t>";
29 iframe.onload = next; 29 iframe.onload = next;
30 document.body.appendChild(iframe); 30 document.body.appendChild(iframe);
31 } 31 }
32 32
33 if (window.testRunner) { 33 if (window.testRunner) {
34 testRunner.dumpAsText(); 34 testRunner.dumpAsText();
35 testRunner.waitUntilDone(); 35 testRunner.waitUntilDone();
36 } 36 }
37 37
38 next(); 38 next();
39 39
40 </script> 40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698