| OLD | NEW |
| 1 description("Tests that when an exception is thrown in the success callback, the
error callback is not invoked. Note that this test throws an exception which is
not caught."); | 1 description("Tests that when an exception is thrown in the success callback, the
error callback is not invoked. Note that this test throws an exception which is
not caught."); |
| 2 | 2 |
| 3 var mockLatitude = 51.478; | 3 var mockLatitude = 51.478; |
| 4 var mockLongitude = -0.166; | 4 var mockLongitude = -0.166; |
| 5 var mockAccuracy = 100; | 5 var mockAccuracy = 100; |
| 6 | 6 |
| 7 if (!window.testRunner || !window.mojo) | |
| 8 debug('This test can not run without testRunner or mojo'); | |
| 9 | |
| 10 var position; | 7 var position; |
| 11 | 8 |
| 12 geolocationServiceMock.then(mock => { | 9 geolocationServiceMock.then(mock => { |
| 13 mock.setGeolocationPermission(true); | 10 mock.setGeolocationPermission(true); |
| 14 mock.setGeolocationPosition(mockLatitude, | 11 mock.setGeolocationPosition(mockLatitude, |
| 15 mockLongitude, | 12 mockLongitude, |
| 16 mockAccuracy); | 13 mockAccuracy); |
| 17 navigator.geolocation.getCurrentPosition(function(p) { | 14 navigator.geolocation.getCurrentPosition(function(p) { |
| 18 position = p; | 15 position = p; |
| 19 shouldBe('position.coords.latitude', 'mockLatitude'); | 16 shouldBe('position.coords.latitude', 'mockLatitude'); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 }); | 29 }); |
| 33 }); | 30 }); |
| 34 | 31 |
| 35 function assertWeGotException() | 32 function assertWeGotException() |
| 36 { | 33 { |
| 37 shouldHaveHadError(); | 34 shouldHaveHadError(); |
| 38 finishJSTest(); | 35 finishJSTest(); |
| 39 } | 36 } |
| 40 | 37 |
| 41 window.jsTestIsAsync = true; | 38 window.jsTestIsAsync = true; |
| OLD | NEW |