Closed Bug 2000801 Opened 2 months ago Closed 1 month ago

JSON serialization of Chrome Windows is broken

Categories

(Remote Protocol :: Marionette, defect, P2)

defect
Points:
3

Tracking

(firefox147 fixed)

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

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

Attachments

(6 files)

The current code in Marionette is not able to correctly serialize a ChomeWindow into a WebWindow reference due to the following issue:

  • When cloning the ChromeWindow to JSON we assume that each top-level browsing context has a browserId. This doesn't apply for top-level browsing contexts in a ChromeWindow. We need to use the browsing context directly instead.
  • All the logic around creating a navigable id for a ChromeWindow and using it later is currently based on the _chromeWindowHandles map from the WindowManager. This is not correct for Marionette because its term of window is the top-level browsing context, but not the window itself. As such we need the logic from the NaviableManager.

I need the correct logic to write proper wdspec tests for bug 1944568.

This is more complicated than I initially thought. While we still have to support unloaded tabs it might be good to keep the browserId as reference for top-level content browsing contexts. But having the chrome browsing context handles in the same map will then cause conflicts because ids are overlapping.

That means when I want to fix the above mentioned issues I need to keep using browserId, but already use the extra chrome id map as backed by the BiMap class as introduced on bug 1944568. I need to do more refactoring to get this finished.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Severity: -- → S3
Points: --- → 3
Priority: -- → P2
Whiteboard: [webdriver:m18]
Blocks: 2002949
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/99ebb5f0a440 https://hg.mozilla.org/integration/autoland/rev/49908c966ae2 [webdriver-client] Reformat classic client with black. r=jgraham,jdescottes https://github.com/mozilla-firefox/firefox/commit/2633fd83c25f https://hg.mozilla.org/integration/autoland/rev/253e94b59cdb [webdriver-client] Assert for valid id when creating WebReference instances. r=jgraham,jdescottes https://github.com/mozilla-firefox/firefox/commit/a091e7c4c132 https://hg.mozilla.org/integration/autoland/rev/3926b82031cb [remote] Add class for bi-directional maps (BiMap). r=jdescottes https://github.com/mozilla-firefox/firefox/commit/5eea86343d63 https://hg.mozilla.org/integration/autoland/rev/1f3ddd9baedb [remote] Update Navigable Manager for parent process browsing contexts. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/bac2666086e2 https://hg.mozilla.org/integration/autoland/rev/b29d709c2834 [marionette] Fix JSON serialization and deserialization of chrome windows. r=jdescottes https://github.com/mozilla-firefox/firefox/commit/6e586279cd09 https://hg.mozilla.org/integration/autoland/rev/49c5526b88eb [wdspec] Add Mozilla-specific tests for chrome window handles. r=frontend-codestyle-reviewers,jdescottes,mossop
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Whiteboard: [webdriver:m18] → [webdriver:m18], [wptsync upstream error]
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56408 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m18], [wptsync upstream error] → [webdriver:m18], [wptsync upstream]
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Upstream PR merged by moz-wptsync-bot
Regressions: 2003540
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: