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

Side by Side Diff: LayoutTests/http/tests/security/suborigins/suborigin-valid-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>Valid 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 "foobar",
12 "foob4r",
13 "Foobar",
14 "FOOBAR",
15 "42",
16 ];
17
18 var iframe;
19 var i = 0;
20 function next() {
21 name = test_suborigin_names[i];
22 i++;
23 iframe.src = "resources/childsuborigin.php?suborigin=" + name;
24 }
25
26 window.onmessage = function() {
27 if (i > test_suborigin_names.length)
28 done();
29
30 var secret = '';
31 try {
32 secret = iframe.contentWindow.secret;
33 assert_unreached();
34 } catch(e) {
35 assert_equals(secret, "", "The parent frame should never be able to get the secret value from the child iframe.");
36 };
37 next();
38 };
39
40 window.onload = function() {;
41 iframe = document.getElementById('iframe');
42 next();
43 };
44 </script>
45 <iframe id="iframe"></iframe>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698