Closed Bug 1623581 Opened 3 months ago Closed 2 months ago

Add support for "returnByValue" and "awaitPromise" to Runtime.evaluate

Categories

(Remote Protocol :: Runtime, task, P1)

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
Tracking Status
firefox76 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [puppeteer-beta-mvp])

Attachments

(4 files)

Puppeteer uses it in _evaluateInternal() (ExecutionContext.js) with the value set to both true and false. We should implement that given that it is part of Runtime.evaluate and highly used.

I will do it beside the work on bug 1623484.

Whiteboard: [puppeteer-beta-reserve] → [puppeteer-beta-mvp]

As noticed we also miss waitPromise, which actually can cause hanging promises and as result crashing Puppeteer unit tests. As seen lately that happens a lot for waitForSelector(). As such lets also get it implemented here, which basically is hopefully a copy and paste from Runtime.callFunctionOn only.

Summary: Add support for returnByValue to Runtime.evaluate → Add support for "returnByValue" and "awaitPromise" to Runtime.evaluate

Tests are mixing APIs between each other, which this patch removes.

Also error messages have been adjusted for both methods to
be on par with Chrome.

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9f32172ae499
[remote] Refactor Runtime.evaluate and Runtime.callFunctionOn browser chrome tests. r=remote-protocol-reviewers,maja_zf
https://hg.mozilla.org/integration/autoland/rev/36920c4ef850
[remote] Add "returnByValue" support to Runtime.evaluate. r=remote-protocol-reviewers,maja_zf
https://hg.mozilla.org/integration/autoland/rev/c92f0faccdb5
[remote] Add "awaitPromise" support to Runtime.evaluate. r=remote-protocol-reviewers,maja_zf
https://hg.mozilla.org/integration/autoland/rev/bebf8622dd3b
[puppeteer] Update expected tests for Puppeteer. r=remote-protocol-reviewers,maja_zf
Regressions: 1624785
You need to log in before you can comment on or make changes to this bug.