(In reply to Paul Zühlcke [:pbz] from comment #14) > There could be a race condition with how we handle `pagehide` events. Since they are fired in the content process, in the new implementation they are sent to the parent via an [async actor message](https://searchfox.org/mozilla-central/search?q=Prompt%3AOnPageHide&path=). The old implementation handled this with an [event listener in Prompter.jsm](https://searchfox.org/mozilla-central/diff/3075dbd453f011aaf378bcac6b2700dccfcf814c/toolkit/components/prompts/src/Prompter.jsm#517) in the content process. So given that browser (+ JSWindowActor pair) is reused it could be side effects from a preceding test. Given that removing the pagehide window actor message fixed the issue this was most likely the cause for the intermittent tests. That was the switch from an event listener in the content process here: https://searchfox.org/mozilla-central/rev/74bd4471abc8545c9a12424b33c6d90889b864aa/toolkit/components/prompts/src/Prompter.jsm#608 to the async window actor message here: https://searchfox.org/mozilla-central/rev/3075dbd453f011aaf378bcac6b2700dccfcf814c/browser/actors/PromptChild.jsm#18 TLDR: In 77 there could be situations in the test environment where the pagehide of the previous page could cause a prompt spawned in the new page to be closed early. However, only if the window (+ the associated window actor) of the old page is reused for the new page.
Bug 1631362 Comment 34 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Paul Zühlcke [:pbz] from comment #14) > There could be a race condition with how we handle `pagehide` events. Since they are fired in the content process, in the new implementation they are sent to the parent via an [async actor message](https://searchfox.org/mozilla-central/search?q=Prompt%3AOnPageHide&path=). The old implementation handled this with an [event listener in Prompter.jsm](https://searchfox.org/mozilla-central/diff/3075dbd453f011aaf378bcac6b2700dccfcf814c/toolkit/components/prompts/src/Prompter.jsm#517) in the content process. So given that browser (+ JSWindowActor pair) is reused it could be side effects from a preceding test. Given that removing the pagehide window actor message fixed the issue this was most likely the cause for the intermittent tests. That was the switch from an event listener in the content process here: https://searchfox.org/mozilla-central/rev/74bd4471abc8545c9a12424b33c6d90889b864aa/toolkit/components/prompts/src/Prompter.jsm#608 to the async window actor message here: https://searchfox.org/mozilla-central/rev/3075dbd453f011aaf378bcac6b2700dccfcf814c/browser/actors/PromptChild.jsm#18 TLDR: In 77 there could be situations in the test environment where the `pagehide` event of the previous page could cause a prompt spawned in the new page to be closed early. However, only if the window (+ the associated window actor) of the old page is reused for the new page.