timeout-zero.js revision 545e470e52f0ac6a3a072bf559c796b42c6066b6
1description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); 2 3if (window.layoutTestController) 4 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 5 6var error; 7navigator.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 19window.jsTestIsAsync = true; 20window.successfullyParsed = true; 21