Home | History | Annotate | Download | only in script-tests
      1 description("Tests that when a watch times out and is cleared from the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111.");
      2 
      3 if (window.layoutTestController)
      4     layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
      5 
      6 var error;
      7 var watchId = navigator.geolocation.watchPosition(function() {
      8     testFailed('Success callback invoked unexpectedly');
      9     finishJSTest();
     10 }, function(e) {
     11     error = e;
     12     shouldBe('error.code', 'error.TIMEOUT');
     13     shouldBe('error.message', '"Timeout expired"');
     14     navigator.geolocation.clearWatch(watchId);
     15     window.setTimeout(finishJSTest, 0);
     16 }, {
     17     timeout: 0
     18 });
     19 
     20 
     21 window.jsTestIsAsync = true;
     22 window.successfullyParsed = true;
     23