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 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 4 5 var error; 6 var watchId = navigator.geolocation.watchPosition(function() { 7 testFailed('Success callback invoked unexpectedly'); 8 window.layoutTestController.notifyDone(); 9 }, function(e) { 10 error = e 11 shouldBe('error.code', 'error.TIMEOUT'); 12 shouldBe('error.message', '"Timeout expired"'); 13 navigator.geolocation.clearWatch(watchId); 14 window.setTimeout(completeTest, 0); 15 }, { 16 timeout: 0 17 }); 18 19 function completeTest() 20 { 21 debug('<br /><span class="pass">TEST COMPLETE</span>'); 22 window.layoutTestController.notifyDone(); 23 } 24 window.layoutTestController.waitUntilDone(); 25 26 var isAsynchronous = true; 27 var successfullyParsed = true; 28