[wdspec] Add tests for using element and shadow root references of nodes that have been garbage collected
Categories
(Remote Protocol :: Marionette, task, P2)
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.
| Reporter | ||
Comment 1•3 years ago
|
||
Just a matter of setting a preference.
Comment 2•3 years ago
|
||
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.
| Reporter | ||
Comment 3•3 years ago
|
||
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
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Comment 4•2 years ago
|
||
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.
Description
•