Overriding geolocation via webdriver lets two services active in parallel
Categories
(Core :: DOM: Geolocation, defect, P3)
Tracking
()
People
(Reporter: saschanaz, Assigned: Sasha)
References
Details
(Whiteboard: [webdriver:m16])
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
(Context: https://bugzilla.mozilla.org/show_bug.cgi?id=1960651#c7)
I think we have a hidden webdriver-related bug we missed in bug 1951962.
The core problem is that we get two active backing services here: https://searchfox.org/mozilla-central/rev/8867630d67bfe76f6065df08d60381d45d73c439/dom/geolocation/Geolocation.cpp#1086-1092
if (mService) {
mService->AddLocator(this);
}
if (mServiceOverride) {
mServiceOverride->AddLocator(this);
}
Both are free to ping the locator, meaning even if watchPosition() is called after SetGeolocationServiceOverride(), a few seconds later the update from the "real" service will ping the locator again, resulting mishmash of signals from different services.
This has been hidden because of the timer, and removing the timer made it more apparent.
Sasha, care to take another look?
| Assignee | ||
Comment 1•8 months ago
|
||
| Assignee | ||
Comment 2•8 months ago
|
||
Yes, so I had a problem which this test illustrates: https://searchfox.org/mozilla-central/source/dom/geolocation/test/browser/browser_geolocation_override.js#245-358, that if we would add an override, reload the tab and then reset the override, a new service wouldn't have a locator. So the solution I came up with was to always have an original service as well, but as you said, it doesn't work with your patch. I found a different approach now: to move locators when we reset an override service. It seems to be working with your patch as well (all the tests pass).
Updated•8 months ago
|
| Reporter | ||
Comment 3•8 months ago
|
||
(Not only it doesn't work with my patch, the webdriver users would also get confusing geolocation signals that they did not make)
| Assignee | ||
Updated•8 months ago
|
Comment 5•8 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 6•8 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D246564
Updated•8 months ago
|
Comment 7•8 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: The geolocation API might sent the original coordinates togerher with the override
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: None
- Risk associated with taking this patch: Low
- Explanation of risk level: It only affects test automation scenario
- String changes made/needed: None
- Is Android affected?: yes
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Description
•