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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-names.html

Issue 2370843003: Suborigin LayoutTest formatting and refactoring (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Invalid suborigin names</title> 4 <meta charset="utf-8">
5 <title>Invalid suborigin names</title>
5 </head> 6 </head>
6 7
7 <script> 8 <script>
8 if (window.testRunner) { 9 if (window.testRunner) {
9 testRunner.dumpAsText(); 10 testRunner.dumpAsText();
10 testRunner.waitUntilDone(); 11 testRunner.waitUntilDone();
11 } 12 }
12 13
13 function finish() { 14 function finish() {
14 if (window.testRunner) 15 if (window.testRunner)
15 testRunner.notifyDone(); 16 testRunner.notifyDone();
16 } 17 }
17 18
18 var test_suborigin_names = [ 19 var test_suborigin_names = [
19 "", 20 '',
20 "'foobar'", 21 '\'foobar\'',
21 "'foobar", 22 '\'foobar',
22 "foobar'", 23 'foobar\'',
23 "foo'bar", 24 'foo\'bar',
24 "foob@r", 25 'foob@r',
25 "foo bar", 26 'foo bar',
26 "Foobar", 27 'Foobar',
27 "FOOBAR", 28 'FOOBAR',
28 ]; 29 ];
29 30
30 var iframe; 31 var iframe;
31 var i = 0; 32 var i = 0;
32 function next() { 33 function next() {
33 if (i >= test_suborigin_names.length) 34 if (i >= test_suborigin_names.length)
34 finish(); 35 finish();
35 document.getElementById('iframe').src = "resources/reach-into-iframe.php?chi ldsuborigin=" + test_suborigin_names[i]; 36 document.getElementById('iframe').src = 'resources/reach-into-iframe.php?' +
36 i++; 37 'childsuborigin=' +
38 test_suborigin_names[i];
39 i++;
37 } 40 }
38 41
39 window.onmessage = function(event) { 42 window.onmessage = function(event) {
40 alert(event.data); 43 alert(event.data);
41 next(); 44 next();
42 }; 45 };
43 46
44 window.onload = function() {; 47 window.onload = function() {
45 next(); 48 next();
46 }; 49 };
47 </script> 50 </script>
48 <iframe id="iframe"></iframe> 51 <iframe id="iframe"></iframe>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698