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> |