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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html
diff --git a/LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html b/LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html
new file mode 100644
index 0000000000000000000000000000000000000000..aea6f446219ed7e1a19e6d9bc7c9551837e5676d
--- /dev/null
+++ b/LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Valid suborigin names</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+
+<script>
+var test_suborigin_names = [
+ "foobar",
+ "foob4r",
+ "Foobar",
+ "FOOBAR",
+ "42",
+];
+
+var iframe;
+var i = 0;
+function next() {
+ name = test_suborigin_names[i];
+ i++;
+ iframe.src = "resources/childsuborigin.php?suborigin=" + name;
+}
+
+window.onmessage = function() {
+ if (i > test_suborigin_names.length)
+ done();
+
+ var secret = '';
+ try {
+ secret = iframe.contentWindow.secret;
+ assert_unreached();
+ } catch(e) {
+ assert_equals(secret, "", "The parent frame should never be able to get the secret value from the child iframe.");
+ };
+ next();
+};
+
+window.onload = function() {;
+ iframe = document.getElementById('iframe');
+ next();
+};
+</script>
+<iframe id="iframe"></iframe>

Powered by Google App Engine
This is Rietveld 408576698