Commit 7aa0f4c2 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

Fix http/tests/inspector-protocol/access-inspected-object.js

... by making sure the iframe under test is in-process (there's no point
for testing for OOPIF, since JS context isolation is provided naturally
there).

Bug: 608015
Change-Id: I81382e9e0c8943c67c0226582c90f57a3964dd68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216640Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772271}
parent 8c9a47fa
......@@ -100,7 +100,6 @@ crbug.com/1050826 external/wpt/mixed-content/gen/top.http-rp/opt-in/object-tag.h
# Tests temporarily disabled with Site Isolation - uninvestigated bugs:
# TODO(lukasza, alexmos): Burn down this list.
crbug.com/608015 http/tests/inspector-protocol/access-inspected-object.js [ Failure Timeout ]
crbug.com/623268 http/tests/inspector-protocol/request-mixed-content-status-blockable.js [ Timeout ]
crbug.com/623268 http/tests/inspector-protocol/request-mixed-content-status-none.js [ Timeout ]
crbug.com/623268 http/tests/inspector-protocol/request-mixed-content-status-optionally-blockable.js [ Timeout ]
......
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank(
const {page, session, dp} = await testRunner.startURL(
'http://example.test:8000/inspector-protocol/resources/test-page.html',
`Test that code evaluated in the main frame cannot access $0 that resolves into a node in a frame from a different domain. Bug 105423.`);
await session.evaluateAsync(`
var frame = document.createElement('iframe');
frame.id = 'myframe';
frame.src = 'http://localhost:8000/inspector-protocol/resources/test-page.html';
frame.src = 'http://subdomain.example.test:8000/inspector-protocol/resources/test-page.html';
document.body.appendChild(frame);
new Promise(f => frame.onload = f)
`);
var documentNodeId = (await dp.DOM.getDocument()).result.root.nodeId;
const documentNodeId = (await dp.DOM.getDocument()).result.root.nodeId;
dp.DOM.onSetChildNodes(onSetChildNodes);
async function onSetChildNodes(messageObject) {
var node = messageObject.params.nodes[0];
const node = messageObject.params.nodes.pop();
if (!node || node.nodeName !== 'IFRAME')
return;
dp.DOM.offSetChildNodes(onSetChildNodes);
var response = await dp.DOM.querySelector({nodeId: node.contentDocument.nodeId, selector: 'div#rootDiv'});
const response = await dp.DOM.querySelector({nodeId: node.contentDocument.nodeId, selector: 'div#rootDiv'});
await dp.DOM.setInspectedNode({nodeId: response.result.nodeId});
testRunner.log(await dp.Runtime.evaluate({expression: '$0', includeCommandLineAPI: true}));
testRunner.completeTest();
}
var response = await dp.DOM.querySelector({nodeId: documentNodeId, selector: 'iframe#myframe'});
const response = await dp.DOM.querySelector({nodeId: documentNodeId, selector: 'iframe#myframe'});
if (response.error) {
testRunner.fail(response.error);
testRunner.completeTest();
......
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