mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 824432 - Don't cancel request if it's a watch request. r=jdm
This commit is contained in:
parent
742e5a2607
commit
1c9bec0e39
@ -340,15 +340,22 @@ nsGeolocationRequest::NotifyError(int16_t errorCode)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsGeolocationRequest::Notify(nsITimer* aTimer)
|
nsGeolocationRequest::Notify(nsITimer* aTimer)
|
||||||
{
|
{
|
||||||
// If we haven't gotten an answer from the geolocation
|
if (mCleared) {
|
||||||
// provider yet, cancel the request. Same logic as
|
return NS_OK;
|
||||||
// ::Cancel, just a different error
|
}
|
||||||
|
|
||||||
|
// If we haven't gotten an answer from the geolocation
|
||||||
|
// provider yet, fire a TIMEOUT error and reset the timer.
|
||||||
|
if (!mIsWatchPositionRequest) {
|
||||||
|
mLocator->RemoveRequest(this);
|
||||||
|
}
|
||||||
|
|
||||||
// remove ourselves from the locator's callback lists.
|
|
||||||
mLocator->RemoveRequest(this);
|
|
||||||
NotifyError(nsIDOMGeoPositionError::TIMEOUT);
|
NotifyError(nsIDOMGeoPositionError::TIMEOUT);
|
||||||
|
|
||||||
mTimeoutTimer = nullptr;
|
if (mIsWatchPositionRequest) {
|
||||||
|
SetTimeoutTimer();
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,12 +26,19 @@ resume_geolocationProvider();
|
|||||||
force_prompt(true);
|
force_prompt(true);
|
||||||
|
|
||||||
var watchID;
|
var watchID;
|
||||||
|
var times = 0;
|
||||||
|
|
||||||
function errorCallback(err) {
|
function errorCallback(err) {
|
||||||
ok(err.code == err.TIMEOUT, "ensure error is a timeout.");
|
ok(err.code == err.TIMEOUT, "ensure error is a timeout.");
|
||||||
resume_geolocationProvider();
|
times++;
|
||||||
reset_prompt();
|
|
||||||
SimpleTest.finish();
|
// make sure we got at least 3 times errorCallback
|
||||||
|
if (times >= 3) {
|
||||||
|
navigator.geolocation.clearWatch(watchID);
|
||||||
|
resume_geolocationProvider();
|
||||||
|
reset_prompt();
|
||||||
|
SimpleTest.finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function successCallback(position) {
|
function successCallback(position) {
|
||||||
|
Loading…
Reference in New Issue
Block a user