Home | History | Annotate | Download | only in script-tests
      1 description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT.");
      2 
      3 if (window.layoutTestController)
      4     layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
      5 
      6 var error;
      7 navigator.geolocation.getCurrentPosition(function(p) {
      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     finishJSTest();
     15 }, {
     16     timeout: 0
     17 });
     18 
     19 window.jsTestIsAsync = true;
     20 window.successfullyParsed = true;
     21