Bug 1061186 - increase timeout from 500ms to 1sec to avoid rare failures. r=jdm
authorGarvan Keeley <gkeeley@mozilla.com>
Fri, 19 Sep 2014 16:55:00 +0200
changeset 208931 48a74ac43195553bee8aefde0ba6dc649cbcefa5
parent 208930 e048332ea3067fc4031ef72c57259b9a28075373
child 208932 f36f3a13dd61321be9cd4338ac281c70877c91ae
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjdm
bugs1061186
milestone35.0a1
Bug 1061186 - increase timeout from 500ms to 1sec to avoid rare failures. r=jdm
dom/tests/mochitest/geolocation/test_mozsettings.html
--- a/dom/tests/mochitest/geolocation/test_mozsettings.html
+++ b/dom/tests/mochitest/geolocation/test_mozsettings.html
@@ -9,23 +9,25 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="geolocation_common.js"></script>
 
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=777594">Mozilla Bug 777594</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
+var timeToWaitMs = 1000;
+
 resume_geolocationProvider(function() {
   force_prompt(true, test1);
 });
 
 if (SpecialPowers.isMainProcess()) {
   SpecialPowers.Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
 }
 
@@ -41,41 +43,41 @@ function test1() {
 function test2() {
   ok(navigator.geolocation, "get geolocation object");
 
   toggleGeolocationSetting(false, function() {
       ok(true, "turned off geolocation via mozSettings");
       setTimeout(function() {
 	  navigator.geolocation.getCurrentPosition(successCallbackAfterMozsettingOff,
                                                    failureCallbackAfterMozsettingOff);
-        }, 500); // need to wait a bit for all of these async callbacks to finish
+        }, timeToWaitMs); // need to wait a bit for all of these async callbacks to finish
   });
 }
 
 function successCallbackAfterMozsettingOff(position) {
   ok(false, "Success callback should not have been called after setting geolocation.enabled to false.");
 
   toggleGeolocationSetting(true, function() {
       ok(true, "turned on geolocation via mozSettings");
       setTimeout(function() {
          navigator.geolocation.getCurrentPosition(successCallbackAfterMozsettingOn,
                                                   failureCallbackAfterMozsettingOn);
-        }, 500); // need to wait a bit for all of these async callbacks to finish
+        }, timeToWaitMs); // need to wait a bit for all of these async callbacks to finish
     });
 }
 
 function failureCallbackAfterMozsettingOff(error) {
   ok(true, "Geolocation didn't work after setting geolocation.enabled to false.");
 
   toggleGeolocationSetting(true, function() {
       ok(true, "turned on geolocation via mozSettings");
       setTimeout(function() {
          navigator.geolocation.getCurrentPosition(successCallbackAfterMozsettingOn,
                                                   failureCallbackAfterMozsettingOn);
-        }, 500); // need to wait a bit for all of these async callbacks to finish
+        }, timeToWaitMs); // need to wait a bit for all of these async callbacks to finish
     });
 }
 
 function successCallbackAfterMozsettingOn(position) {
   ok(true, "Geolocation worked after setting geolocation.enabled to true.");
   SimpleTest.finish();
 }