diff --git a/dom/tests/mochitest/geolocation/geolocation.html b/dom/tests/mochitest/geolocation/geolocation.html
index 5e60f14ea687..e62f13e7d399 100644
--- a/dom/tests/mochitest/geolocation/geolocation.html
+++ b/dom/tests/mochitest/geolocation/geolocation.html
@@ -3,7 +3,10 @@
Simple access of geolocation
diff --git a/dom/tests/mochitest/geolocation/test_clearWatch.html b/dom/tests/mochitest/geolocation/test_clearWatch.html
index 84b9cef166d7..7da510c861e7 100644
--- a/dom/tests/mochitest/geolocation/test_clearWatch.html
+++ b/dom/tests/mochitest/geolocation/test_clearWatch.html
@@ -36,11 +36,13 @@ function successCallback(position) {
if (hasBeenCleared == true) {
successWasCalledAfterClear = true;
}
+ SimpleTest.executeSoon(clearWatch);
}
function clearWatch() {
navigator.geolocation.clearWatch(watchID);
hasBeenCleared = true;
+ SimpleTest.executeSoon(testAccepted);
}
function testAccepted() {
@@ -52,10 +54,6 @@ function testAccepted() {
watchID = navigator.geolocation.watchPosition(successCallback, failureCallback, null);
-setTimeout(clearWatch, 250);
-
-setTimeout(testAccepted, 2000);
-