Closed Bug 1927073 Opened 3 months ago Closed 3 months ago

"RootTransport._sendCommandToBrowsingContext" fails when browsing context was replaced

Categories

(Remote Protocol :: Agent, defect, P3)

defect
Points:
3

Tracking

(firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [webdriver:m13][webdriver:relnote])

Attachments

(1 file)

When trying to write a test for bug 1921314 I noticed that RootTransport._sendCommandToBrowsingContext() currently fails when the specified browsing context was replaced by a navigation. This happens because we never update the browsing context within a root module method and will continue using it when forwarding a command to the window global. Specifically root module commands are affected that internally call certain methods from the window global module with a delay.

As result we currently fail here with a webProgress that is null:

   let attempts = 0;
    while (true) {
      try {
        if (!webProgress.browsingContext.currentWindowGlobal) {
          await lazy.waitForCurrentWindowGlobal(webProgress.browsingContext);
        }

In case of retries are allowed for the actual command we should try to retrieve the new top-level browsing context for the associated browser element and use its webProgress instead.

Blocks: 1927144
Attachment #9433313 - Attachment description: WIP: Bug 1927073 - [remote] Retrieve new browsing context if old one was replaced when forwarding a command to the window global. → Bug 1927073 - [remote] Retrieve new browsing context if old one was replaced when forwarding a command to the window global.
Points: --- → 3
Whiteboard: [webdriver:m13]
See Also: → 1927412
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d9461994ee82 [remote] Retrieve new browsing context if old one was replaced when forwarding a command to the window global. r=webdriver-reviewers,jdescottes
Regressions: 1927689
No longer regressions: 1927689
Regressions: 1927689
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
See Also: → 1930530
Blocks: 1925932
Whiteboard: [webdriver:m13] → [webdriver:m13][webdriver:relnote]
Regressions: 1941264
No longer regressions: 1927689
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: