1 description("Tests that when timeout is non-zero, the success callback is called as expected."); 2 3 var mockLatitude = 51.478; 4 var mockLongitude = -0.166; 5 var mockAccuracy = 100.0; 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 11 12 var position; 13 navigator.geolocation.getCurrentPosition(function(p) { 14 position = p; 15 shouldBe('position.coords.latitude', 'mockLatitude'); 16 shouldBe('position.coords.longitude', 'mockLongitude'); 17 shouldBe('position.coords.accuracy', 'mockAccuracy'); 18 debug('<br /><span class="pass">TEST COMPLETE</span>'); 19 window.layoutTestController.notifyDone(); 20 }, function(e) { 21 testFailed('Error callback invoked unexpectedly'); 22 window.layoutTestController.notifyDone(); 23 }, { 24 timeout: 1000 25 }); 26 window.layoutTestController.waitUntilDone(); 27 28 var isAsynchronous = true; 29 var successfullyParsed = true; 30