Closed Bug 1121698 Opened 9 years ago Closed 4 years ago

Allow to wait for observer notifications when opening new chrome windows


(Remote Protocol :: Marionette, defect, P3)

Version 2


(Not tracked)



(Reporter: whimboo, Unassigned)



(Keywords: pi-marionette-firefox-puppeteer, Whiteboard: [lib])

Marionette is only able to return a list of open chrome windows. But it is not clear in which state such a window is. Especially when tests are opening or closing chrome windows, they have to wait until the window has e.g. been completely loaded. This can be done by listening for the appropriate observer notifications.

Currently we have this implemented in our mozmill-tests repository in the windows module:

To be able to get started we need the feature to work with observers. This is being worked on in bug 1121691.
Depends on: 1123401
No longer blocks: 1119715
Product: Mozilla QA → Testing
Blocks: 1523133

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:

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.,2618-2619

Component: Firefox UI Tests → Marionette
QA Contact: hskupin
Summary: Implement fail-safe handling of chrome windows → Allow to wait for observer notifications when opening new chrome windows

To be able to use promises I have to get bug 1398095 fixed first.

Depends on: 1398095
Priority: -- → P3

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.

Closed: 4 years ago
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.