Chromium Code Reviews| 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'); |
| } |