-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support adding iframes with srcdoc attributes in remote context helper.
This makes executor-window.py a bit smarter - have it pass the UUID when starting the executor. - move extra-script handling for the window executor into the python - move extracting `startOn` param into the python This makes it possible to just put the whole thing into the srcdoc attribute (after fixing some URL generating code to handle srcdocs). Bug: 1491597 Change-Id: Ib4825ad7f117fd9db04a4203315989ec1c26412c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4979845 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Fergal Daly <fergal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1216784}
- Loading branch information
Showing
8 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc-startOn.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// META: title=RemoteContextWrapper addIframe with srcdoc and startOn | ||
// META: script=/common/dispatcher/dispatcher.js | ||
// META: script=/common/get-host-info.sub.js | ||
// META: script=/common/utils.js | ||
// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js | ||
// META: script=./resources/test-helper.js | ||
|
||
'use strict'; | ||
|
||
promise_test(async t => { | ||
const rcHelper = new RemoteContextHelper(); | ||
|
||
const main = await rcHelper.addWindow(); | ||
|
||
const iframe = await main.addIframeSrcdoc( | ||
/*extraConfig=*/ {startOn: 'pageshow'}); | ||
|
||
await assertSimplestScriptRuns(iframe); | ||
await assert_equals( | ||
await iframe.executeScript(() => { | ||
return executorStartEvent.type; | ||
}), | ||
'pageshow'); | ||
}); |
27 changes: 27 additions & 0 deletions
27
...wpt/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// META: title=RemoteContextWrapper addIframe with srcdoc | ||
// META: script=/common/dispatcher/dispatcher.js | ||
// META: script=/common/get-host-info.sub.js | ||
// META: script=/common/utils.js | ||
// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js | ||
// META: script=./resources/test-helper.js | ||
|
||
'use strict'; | ||
|
||
// This tests that arguments passed to the constructor are respected. | ||
promise_test(async t => { | ||
const rcHelper = new RemoteContextHelper(); | ||
|
||
const main = await rcHelper.addWindow(); | ||
|
||
const iframe = await main.addIframeSrcdoc( | ||
/*extraConfig=*/ {scripts: ['./resources/test-script.js']}, | ||
/*attributes=*/ {id: 'test-id'}, | ||
); | ||
|
||
await assertSimplestScriptRuns(iframe); | ||
await assertFunctionRuns(iframe, () => testFunction(), 'testFunction exists'); | ||
|
||
assert_equals( | ||
await main.executeScript(() => document.getElementById('test-id').id), | ||
'test-id', 'verify id'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters