Commit 002510a0 authored by danakj's avatar danakj Committed by Commit Bot

Fix the http/tests/devtools/inspect-iframe-from-different-domain.js test

This test wants to verify devtools inspect works with an iframe in
another domain. It was putting the iframe in another site, which causes
it to become detached from the local root in site isolation. Instead,
put both the main frame and iframe into the example.test domain, with
the iframe in a subdomain.

This test was originally added for webkit bug 31587 which is found at
https://bugs.webkit.org/show_bug.cgi?id=31587.

It said:
> If you try to inspect elements located inside an IFRAME that was
> loaded from a different domain, not satisfying the same origin
> policy, Web Inpector in recent WebKit nightly builds cannot show
> style information. Works in Safari 4.0.4.

R=yangguo@chromium.org

Bug: 623268
Change-Id: I842bf835e49ee79e60e423fd36a5d3cedb8a8cfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218765
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772743}
parent de0c6d16
...@@ -4264,7 +4264,6 @@ crbug.com/774463 [ Win7 Debug ] fast/events/autoscroll-should-not-stop-on-keypre ...@@ -4264,7 +4264,6 @@ crbug.com/774463 [ Win7 Debug ] fast/events/autoscroll-should-not-stop-on-keypre
# Sheriff failures 2017-10-23 # Sheriff failures 2017-10-23
crbug.com/772411 http/tests/media/autoplay-crossorigin.html [ Timeout Failure Pass ] crbug.com/772411 http/tests/media/autoplay-crossorigin.html [ Timeout Failure Pass ]
crbug.com/777222 http/tests/devtools/inspect-iframe-from-different-domain.js [ Pass Failure Timeout ]
# Sheriff failures 2017-10-24 # Sheriff failures 2017-10-24
crbug.com/773122 crbug.com/777813 [ Win ] virtual/text-antialias/font-ascent-mac.html [ Failure Pass ] crbug.com/773122 crbug.com/777813 [ Win ] virtual/text-antialias/font-ascent-mac.html [ Failure Pass ]
......
...@@ -6,16 +6,12 @@ ...@@ -6,16 +6,12 @@
TestRunner.addResult( TestRunner.addResult(
`Tests that style properties of elements in iframes loaded from domain different from the main document domain can be inspected. See bug 31587.\n`); `Tests that style properties of elements in iframes loaded from domain different from the main document domain can be inspected. See bug 31587.\n`);
await TestRunner.loadModule('elements_test_runner'); await TestRunner.loadModule('elements_test_runner');
await TestRunner.loadHTML(` await TestRunner.navigatePromise("http://example.test:8000/devtools/resources/empty.html");
<iframe src="http://localhost:8000/devtools/resources/iframe-from-different-domain-data.html" id="receiver" onload="onIFrameLoad()"></iframe>
`);
await TestRunner.evaluateInPagePromise(` await TestRunner.evaluateInPagePromise(`
var onIFrameLoadCalled = false; const frame = document.createElement('iframe');
function onIFrameLoad() frame.src = 'http://other.domain.example.test:8000/devtools/resources/iframe-from-different-domain-data.html';
{ document.body.appendChild(frame);
if (onIFrameLoadCalled) new Promise(f => frame.onload = f)
return;
onIFrameLoadCalled = true; }
`); `);
ElementsTestRunner.selectNodeAndWaitForStyles('iframe-body', step1); ElementsTestRunner.selectNodeAndWaitForStyles('iframe-body', step1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment