Closed Bug 1548102 Opened 5 years ago Closed 5 years ago

Coordinate Page.frameNavigated and Runtime.executionContextDestroyed/Created events

Categories

(Remote Protocol :: CDP, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

Bug 1543095 and bug 1543098 are implementing events being fired by both Page and Runtime domains, but in an inderteministic order.

Whereas we expect to fire and receive these events in a precise order:

  • Runtime.executionContextDestroyed
  • Page.frameNavigated
  • Runtime.executionContextCreated

The issue is that both Page.navigated and Runtime.executionContextCreated are being fired out of DOMWindowCreated gecko event. The event into which they end up being fired depends on the order into which we call Runtime.enable and Page.enable. These enable methods are registering the DOMWindowCreated listeners.

Type: defect → enhancement
Priority: -- → P2
Assignee: poirot.alex → nobody

This work blocks bugs 1543185, 1543151, 1545726 as they are all about using Runtime from another domain.
This work require coordination between Page and Runtime, so I'm expecting this to lay down the typical way two domain should interact between each others.

I submitted a WIP that isn't correct. Instead of coordinating Page and Runtime, it depends on having both domains enabled.
It means that it breaks both domains if one of the two isn't enabled.

I would like to work on this as soon as I'm done with preliminary work related to Runtime, like bug 1548098.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Priority: P2 → P1
Attachment #9063287 - Attachment description: Bug 1548102 - Coordinate Page.frameNavigated and Runtime.executionContextDestroyed/Created events → Bug 1548102 - Coordinate Page.frameNavigated and Runtime.executionContextDestroyed/Created events.

Another linux try run after addressing the review comments:
https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=246150003&revision=0bc183c318a15d209a7870b2ef911b536d85e21d

And a macos run to see if the added test fails on mac:
https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=246150003&revision=4b2b5f3872ba6e4ec340ea3280184d335c9fecf0
(with a few re-runs)

Note for the sheriffs, if this patch causes any intermittent on Mac, I would prefer to disable the test on this platform rather than backing this out.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bb020dacad9
Coordinate Page.frameNavigated and Runtime.executionContextDestroyed/Created events. r=remote-protocol-reviewers,ato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Component: CDP: Runtime → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: