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

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

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address many of mkwst's comments Created 5 years, 8 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Invalid suborigin names</title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 </head>
8
9 <script>
10 var test_suborigin_names = [
11 "",
12 "'foobar'",
13 "'foobar",
14 "foobar'",
15 "foo'bar",
16 "foob@r",
17 "foo bar",
18 ];
19
20 var iframe;
21 var i = 0;
22 function next() {
23 name = test_suborigin_names[i];
24 i++;
25 iframe.src = "resources/childsuborigin.php?suborigin=" + name;
26 }
27
28 window.onmessage = function() {
29 if (i > test_suborigin_names.length)
30 done();
31
32 var secret = '';
33 try {
34 secret = iframe.contentWindow.secret;
35 assert_equals(secret, "I am a secret", "The parent frame should always b e able to get the secret value from the child iframe.");
36 } catch(e) {
37 assert_unreached();
38 };
39 next();
40 };
41
42 window.onload = function() {;
43 iframe = document.getElementById('iframe');
44 next();
45 };
46 </script>
47 <iframe id="iframe"></iframe>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698