WebDriver:{ExecuteScript,ExecuteAsyncScript} to use promises internally
Categories
(Remote Protocol :: Marionette, enhancement, P1)
Tracking
(firefox67 fixed)
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | fixed |
People
(Reporter: automatedtester, Assigned: whimboo)
References
(Blocks 2 open bugs)
Details
Attachments
(5 files)
Comment 1•8 years ago
|
||
Comment 2•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
Comment 6•6 years ago
|
||
Following the tests, we are failing six WPT tests related to promises:
https://wpt.fyi/results/webdriver/tests/execute_script/promise.py?label=master&label=experimental&product=chrome&product=firefox&product=safari
| Assignee | ||
Comment 7•6 years ago
|
||
So I got all of those ExecuteScript tests working locally. Actually the tests were faulty too, because they checked for "timeout error" which first doesn't exist, and second should be "script timeout".
I wonder why we don't have those tests for ExecuteAsyncScript, because wrapping the code with a Promise has to happen there too. Andreas, you reviewed the tests for ExecuteScript, so maybe you can remember?
Comment 8•6 years ago
|
||
It’s good that you got the tests working!
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #7)
I wonder why we don't have those tests for ExecuteAsyncScript,
because wrapping the code with a Promise has to happen there
too. Andreas, you reviewed the tests for ExecuteScript, so maybe
you can remember?
It seems like an oversight since both the sync and the async command
uses the same promise-based internal language.
| Assignee | ||
Comment 9•6 years ago
|
||
| Assignee | ||
Comment 10•6 years ago
|
||
The try build shows a couple of failures across Mn and wpt jobs which are all related to the addition of async to allow scripts to use await. The following is visible in the log files:
[Child 56590, Main Thread] WARNING: Silently denied access to property "toJSON": value is callable (@chrome://marionette/content/evaluate.js:281:0): file /builds/worker/workspace/build/src/js/xpconnect/wrappers/XrayWrapper.cpp, line 223
Interestingly this only happens when calling scripts in content scope. In chrome scope it works fine. So whether this is again a problem in Firefox (similar to bug 1453057), or it's in the Marionette code maybe when sending the data to the parent process.
| Assignee | ||
Comment 11•6 years ago
|
||
I replicated the code of Marionette for Marionette, and when it gets run in the browser environment it works. I cannot run for content because it's not a framescript and wouldn't have the permissions to access Cu.
So the code itself should be fine, but there is a problem in Firefox which doesn't allow the object to be JSON serialized.
I would really suggest that we move the await support to a follow-up bug, which will then also make it easier for Firefox devs to check.
| Assignee | ||
Comment 12•6 years ago
|
||
Here the new try build without the await support:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e49623603dda3eb3e704eb70cc345b4be7f23b5c
| Assignee | ||
Comment 13•6 years ago
|
||
| Assignee | ||
Comment 14•6 years ago
|
||
Depends on D19751
| Assignee | ||
Comment 15•6 years ago
|
||
Depends on D19753
| Assignee | ||
Comment 16•6 years ago
|
||
Depends on D19755
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/f390a56e3820
https://hg.mozilla.org/mozilla-central/rev/38fe474b9025
https://hg.mozilla.org/mozilla-central/rev/c69465c47848
https://hg.mozilla.org/mozilla-central/rev/b8393b9641e5
Updated•2 years ago
|
Description
•