| Index: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html
|
| index 1235b6a483d2c27867adf4c92eecac735f08020a..85ebd616dbfbd65b6fb8e26982a89a60165b40b1 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html
|
| @@ -4,8 +4,22 @@
|
| <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;
|
| +function onFrameLoad() {
|
| + if (window.testRunner && !srcChanged) {
|
| + srcChanged = true;
|
| + testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
|
| + var iframe = document.getElementsByTagName('iframe')[0];
|
| + iframe.focus();
|
| + iframe.src = 'http://127.0.0.1:8080/security/resources/cross-frame-iframe-for-parent-isolated-world.html';
|
| + }
|
| +}
|
| +
|
| description('Tests that isolated worlds do not allow cross-origin frame access');
|
| window.jsTestIsAsync = true;
|
|
|
| @@ -21,11 +35,6 @@ if (window.testRunner) {
|
| break;
|
| }
|
| });
|
| -
|
| - testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
|
| - var iframe = document.getElementsByTagName('iframe')[0];
|
| - iframe.focus();
|
| - iframe.src = 'http://127.0.0.1:8080/security/resources/cross-frame-iframe-for-parent-isolated-world.html';
|
| } else {
|
| testFailed('Test depends on LayoutTestController and must be run by DRT');
|
| }
|
|
|