| OLD | NEW |
| (Empty) |
| 1 description("Tests Geolocation error callback using the mock service."); | |
| 2 | |
| 3 var mockMessage = "debug"; | |
| 4 | |
| 5 var error; | |
| 6 | |
| 7 geolocationServiceMock.then(mock => { | |
| 8 mock.setGeolocationPermission(true); | |
| 9 mock.setGeolocationPositionUnavailableError(mockMessage); | |
| 10 | |
| 11 navigator.geolocation.getCurrentPosition(function(p) { | |
| 12 testFailed('Success callback invoked unexpectedly'); | |
| 13 finishJSTest(); | |
| 14 }, function(e) { | |
| 15 error = e; | |
| 16 shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); | |
| 17 shouldBe('error.message', 'mockMessage'); | |
| 18 shouldBe('error.UNKNOWN_ERROR', 'undefined'); | |
| 19 shouldBe('error.PERMISSION_DENIED', '1'); | |
| 20 shouldBe('error.POSITION_UNAVAILABLE', '2'); | |
| 21 shouldBe('error.TIMEOUT', '3'); | |
| 22 finishJSTest(); | |
| 23 }); | |
| 24 }); | |
| 25 | |
| 26 window.jsTestIsAsync = true; | |
| OLD | NEW |