Bug 717243 - Handle multiple geolocation callbacks that can occur before a clearWatch call. r=dougt

This commit is contained in:
Josh Matthews 2012-01-25 02:58:43 -05:00
parent 99084ce2d7
commit 8b683a9a32

View File

@ -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() {