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

Unified Diff: LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html

Issue 1180923003: Add window access checks for Suborigins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests on Windows Created 5 years, 6 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
index aea6f446219ed7e1a19e6d9bc7c9551837e5676d..2ed3d47c5511fc86240d31a6e27db3d66719bc26 100644
--- a/LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html
+++ b/LayoutTests/http/tests/security/suborigins/suborigin-valid-names.html
@@ -2,11 +2,19 @@
<html>
<head>
<title>Valid suborigin names</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
</head>
<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function finish() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
var test_suborigin_names = [
"foobar",
"foob4r",
@@ -18,27 +26,18 @@ var test_suborigin_names = [
var iframe;
var i = 0;
function next() {
- name = test_suborigin_names[i];
+ if (i >= test_suborigin_names.length)
+ finish();
+ document.getElementById('iframe').src = "resources/reach-into-iframe.php?childsuborigin=" + 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.");
- };
+window.onmessage = function(event) {
+ alert(event.data);
next();
};
-window.onload = function() {;
- iframe = document.getElementById('iframe');
+window.onload = function() {
next();
};
</script>

Powered by Google App Engine
This is Rietveld 408576698