Closed Bug 1934326 Opened 1 year ago Closed 2 months ago

"waitForCurrentWindowGlobal()" should check for discarded browser to not unnecessarily wait for the window global

Categories

(Remote Protocol :: Agent, defect, P3)

defect
Points:
2

Tracking

(firefox148 fixed)

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Depends on 1 open bug)

Details

(Whiteboard: [webdriver:m18], [wptsync upstream][webdriver:relnote])

Attachments

(2 files)

As discovered by reviewing https://phabricator.services.mozilla.com/D230661 I noticed that we unnecessarily wait extra 100ms in waitForCurrentWindowGlobal() if the actual window was already closed. This can hopefully be easily fixed by checking if the browsing context is discarded - but note that this flag can be set to true as well if there is a cross-origin navigation. So we need to be careful.

When we can remove the 100ms delay we should also update the BiDi tests as added by https://phabricator.services.mozilla.com/D230663 so that they no longer have to delay by 250ms but just 100ms.

Depends on: 1932916
Depends on: 1935324

Due to the risk of regressions it would be good to wait landing any patch until the next cycle early next year with cycle.

Severity: -- → S3
Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:m14]
Whiteboard: [webdriver:m14] → [webdriver:m15]

I just stumbled over the 250ms timeout in the perform actions wdspec tests while doing a review and thought about to give it a try. Given that I cannot reproduce locally I pushed a try build to get some debug information. Lets see if it still reproduces with MacOS 14.70.

https://treeherder.mozilla.org/jobs?repo=try&searchStr=platform%2Copt&revision=fe33b092ac8b36b49a3cf92a81fcc319b51705bc

Whiteboard: [webdriver:m15] → [webdriver:m16]
Whiteboard: [webdriver:m16] → [webdriver:m17]
Whiteboard: [webdriver:m17] → [webdriver:m18]

I've reduced the pause from 250ms to just 100ms but I'm not able to get into a state when the currentWindowGlobal is not defined. As such I also cannot reproduce the extra delay locally. As such I've pushed a try build with a debug line to see if we actually hit this case and if yes which test is triggering it:

https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=170339

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c7904291c05c https://hg.mozilla.org/integration/autoland/rev/998ca8902bdf [remote] Check for browsing context discarded in "waitForCurrentWindowGlobal()". r=Sasha https://github.com/mozilla-firefox/firefox/commit/e21815e6380e https://hg.mozilla.org/integration/autoland/rev/fb5f293bbbbb [wdspec] Sync duration of pause in action test for closing a browsing context with WebDriver classic. r=Sasha
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56905 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m18] → [webdriver:m18], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
Upstream PR merged by moz-wptsync-bot
See Also: → 2012793
Whiteboard: [webdriver:m18], [wptsync upstream] → [webdriver:m18], [wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: