Bug 1468030 - Geolocation test can sometimes fail with POSITION_UNAVAILABLE on Android. r=jdm, a=test-only
authorChris Peterson <cpeterson@mozilla.com>
Sat, 09 Jun 2018 11:05:49 -0700
changeset 473733 a5aa390759bf99d5b23f5f12d19209889a9c96a3
parent 473732 728f6001d25ca6a9daf6779f833fe4b683d49945
child 473734 5fafd6ba99e4fa2585776b64d32287601f72c363
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, test-only
bugs1468030
milestone61.0
Bug 1468030 - Geolocation test can sometimes fail with POSITION_UNAVAILABLE on Android. r=jdm, a=test-only MozReview-Commit-ID: I7NHyznmCJC
dom/tests/mochitest/geolocation/test_timerRestartWatch.html
--- a/dom/tests/mochitest/geolocation/test_timerRestartWatch.html
+++ b/dom/tests/mochitest/geolocation/test_timerRestartWatch.html
@@ -25,17 +25,18 @@ SimpleTest.waitForExplicitFinish();
 resume_geolocationProvider(function() {
   force_prompt(true, test1);
 });
 
 var watchID;
 var times = 0;
 
 function errorCallback(err) {
-  ok(err.code == err.TIMEOUT, "ensure error is a timeout.");
+  ok(err.code === err.TIMEOUT ||
+     err.code === err.POSITION_UNAVAILABLE, `check error code: ${err.code}`);
   times++;
 
   // make sure we got at least 3 times errorCallback
   if (times >= 3) {
     navigator.geolocation.clearWatch(watchID);
     resume_geolocationProvider(function() {
       set_network_request_cache_enabled(true,
         function() { SimpleTest.finish(); } );