Commit 31d0cfee authored by Daniel Cheng's avatar Daniel Cheng Committed by Chromium LUCI CQ

Fix child frame test case in http/tests/security/isolatedWorld/world-reuse.html

The intent appears to be to execute script in an isolated world in the
child frame's context. However, the iframe completion callback's global
scope is the main frame's global, not the child frame's global. The test
worked anyway, because window.parent simply points to window in the main
frame.

Change-Id: I24915e06ef1dd67cbf4a2de33018da979f39fb57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617135Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841384}
parent 9a7e9074
...@@ -26,9 +26,13 @@ if (window.testRunner) { ...@@ -26,9 +26,13 @@ if (window.testRunner) {
var iframeComplete = function(result) { var iframeComplete = function(result) {
// Isolated world executing in frame should be able to to access parent content. // Isolated world executing in frame should be able to to access parent content.
let childFrameScriptElement = frames[0].document.createElement('script');
childFrameScriptElement.innerText = `
testRunner.evaluateScriptInIsolatedWorld(1, testRunner.evaluateScriptInIsolatedWorld(1,
"parent.document.body.appendChild(parent.document.createTextNode('Expecting true: ' + !!parent.frames[0].document.getElementById('output')));" + "parent.document.body.appendChild(parent.document.createTextNode('Expecting true: ' + !!parent.frames[0].document.getElementById('output')));" +
"parent.document.body.appendChild(parent.document.createElement('br'));"); "parent.document.body.appendChild(parent.document.createElement('br'));");
`;
frames[0].document.body.appendChild(childFrameScriptElement);
document.body.appendChild(document.createTextNode('Expecting undefined,undefined: ' + result)); document.body.appendChild(document.createTextNode('Expecting undefined,undefined: ' + result));
document.body.appendChild(document.createElement('br')); document.body.appendChild(document.createElement('br'));
......
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