mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 717243 - Handle multiple geolocation callbacks that can occur before a clearWatch call. r=dougt
This commit is contained in:
parent
99084ce2d7
commit
8b683a9a32
@ -25,6 +25,7 @@ force_prompt(true)
|
||||
|
||||
var hasBeenCleared = false;
|
||||
var successWasCalledAfterClear = false;
|
||||
var firstCallback = true;
|
||||
|
||||
function failureCallback(error)
|
||||
{
|
||||
@ -37,7 +38,10 @@ function successCallback(position) {
|
||||
if (hasBeenCleared == true) {
|
||||
successWasCalledAfterClear = true;
|
||||
}
|
||||
SimpleTest.executeSoon(clearWatch);
|
||||
if (firstCallback) {
|
||||
SimpleTest.executeSoon(clearWatch);
|
||||
firstCallback = false;
|
||||
}
|
||||
}
|
||||
|
||||
function clearWatch() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user