| OLD | NEW |
| (Empty) |
| 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 var position; | |
| 8 | |
| 9 geolocationServiceMock.then(mock => { | |
| 10 mock.setGeolocationPermission(true); | |
| 11 mock.setGeolocationPosition(mockLatitude, | |
| 12 mockLongitude, | |
| 13 mockAccuracy); | |
| 14 | |
| 15 navigator.geolocation.getCurrentPosition(function(p) { | |
| 16 position = p; | |
| 17 shouldBe('position.coords.latitude', 'mockLatitude'); | |
| 18 shouldBe('position.coords.longitude', 'mockLongitude'); | |
| 19 shouldBe('position.coords.accuracy', 'mockAccuracy'); | |
| 20 finishJSTest(); | |
| 21 }, function(e) { | |
| 22 testFailed('Error callback invoked unexpectedly'); | |
| 23 finishJSTest(); | |
| 24 }, { | |
| 25 timeout: 1000 | |
| 26 }); | |
| 27 }); | |
| 28 | |
| 29 window.jsTestIsAsync = true; | |
| OLD | NEW |