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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html

Issue 2630783003: PlzNavigate: Fix the http/tests/security/cross-frame-access-parent-isolated-world.html and http/tes… (Closed)
Patch Set: Created 3 years, 11 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: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html
index ed1fbd3595d2161963871055b4d2edd15e087eb7..4403c214bbdfb41aaee19f4bed2f84ae794270c7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-isolated-world.html
@@ -4,8 +4,21 @@
<body>
<p id="description"></p>
<p id="console"></p>
-<iframe src="data:text/html,"></iframe>
+<iframe src="data:text/html," onload="onFrameLoad()"></iframe>
<script>
+// We should change the iframe src only after it finishes loading to avoid
+// timing bugs due to PlzNavigate or cases where the browser handles all
+// navigations.
+var srcChanged = false;
ananta 2017/01/14 02:24:55 Should this function be moved to js-test.js or ano
Nate Chapin 2017/01/18 22:14:11 I don't feel strongly, do you see other tests that
+function onFrameLoad() {
+ if (window.testRunner && !srcChanged) {
+ testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
+ var iframe = document.getElementsByTagName('iframe')[0];
+ iframe.focus();
+ iframe.src = 'http://subdomain.example.test:8000/security/resources/cross-frame-iframe-for-parent-isolated-world.html';
+ }
+}
+
window.jsTestIsAsync = true;
if (document.location.hostname == '127.0.0.1') {
document.location.hostname = 'subdomain.example.test';
@@ -25,11 +38,7 @@ if (document.location.hostname == '127.0.0.1') {
}
});
- testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
- var iframe = document.getElementsByTagName('iframe')[0];
- iframe.focus();
document.domain = 'example.test';
- iframe.src = 'http://subdomain.example.test:8000/security/resources/cross-frame-iframe-for-parent-isolated-world.html';
} else {
testFailed('Test depends on LayoutTestController and must be run by DRT');
}

Powered by Google App Engine
This is Rietveld 408576698