Allow to wait for observer notifications when opening new chrome windows
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
References
Details
(Keywords: pi-marionette-firefox-puppeteer, Whiteboard: [lib])
Reporter | ||
Updated•10 years ago
|
Assignee | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•6 years ago
|
||
Seeing more and more code being asynchronous it is getting more important to get this bug fixed. Otherwise race conditions can occur.
Implementing this is actually not that easy. We would have to setup some listener Promise first, which checks for new chrome windows to get opened. Then some code has been run, which triggers the opening of the window. This is mostly a callback in Python code. Then an async execute script call has to wait for the formerly setup Promise to be fulfilled.
As an example how the server code would look like the open browser window command can be used:
https://searchfox.org/mozilla-central/rev/78cd247b5d7a08832f87d786541d3e2204842e8e/testing/marionette/browser.js#307
This would all be a lot of work to do. Seeing that the Marionette client is fading away, firefox-puppeteer would also go away.
As such it may be helpful to just have bug 1507771 fixed, which let us open the window by a chrome URL, and then wait for appropriate events and observer notifications. The only problem with this approach is, that openDialog() and passing over arguments is needed. And that is actually not ideal, because the browser itself should decide which arguments to pass over.
Reporter | ||
Comment 2•6 years ago
|
||
To be able to use promises I have to get bug 1398095 fixed first.
Updated•6 years ago
|
Reporter | ||
Comment 3•5 years ago
|
||
This was actually implemented via bug 1504756. Also we only care about the notifications, for that particular command. For eg clicking a link which opens a browser window, the test has to make sure to wait long enough before accessing this window.
Updated•2 years ago
|
Description
•