Open Bug 1809614 Opened 3 years ago Updated 2 years ago

[wdspec] Add tests for using element and shadow root references of nodes that have been garbage collected

Categories

(Remote Protocol :: Marionette, task, P2)

task
Points:
2

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

Details

(Whiteboard: [webdriver:backlog])

As of now we do not have any test in the wdspec test suite that covers scenarios like interacting with already garbage collected nodes. In those cases the web reference cannot be resolved anymore because nodes are stored in a weak map, and as such get a node returns null. This needs to be correctly handled as stale element reference or detached shadow root error.

The WebDriver classic spec will be fixed with:
https://github.com/w3c/webdriver/pull/1712#issuecomment-1378389983

For writing those tests we might be able to use the TestUtils.gc() helper that other web-platform tests already make use of:

https://searchfox.org/mozilla-central/source/testing/web-platform/tests/common/gc.js

We will have to find a way to expose that to the wdspec pytestrunner tests as well.

Just a matter of setting a preference.

Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:backlog]

TestUtils should just require setting a pref in Gecko: https://searchfox.org/mozilla-central/source/dom/webidl/TestUtils.webidl#11 It might even be set already in wdspec tests, depending on how we set the profile up.

Yes, wdspec share the same preferences as the general wpt tests by using the generic wpt profile:
https://searchfox.org/mozilla-central/rev/a8187e40b492dff78e3d3225e652cc06f447484b/testing/profiles/web-platform/user.js#16-17

Component: geckodriver → Marionette
Product: Testing → Remote Protocol
Version: Default → Trunk

We probable would need this for both the WebDriver classic and BiDi protocols. Given that I'm removing an XPCshell test in bug 1822466 it would be good to have this test as follow-up soon.

Depends on: 1822466, 1830884
You need to log in before you can comment on or make changes to this bug.