| OLD | NEW |
| 1 description("Tests that reentrant calls to Geolocation methods from the error ca
llback are OK."); | 1 description("Tests that reentrant calls to Geolocation methods from the error ca
llback are OK."); |
| 2 | 2 |
| 3 var mockMessage = 'test'; | 3 var mockMessage = 'test'; |
| 4 | 4 |
| 5 if (!window.testRunner || !window.mojo) | |
| 6 debug('This test can not run without testRunner or mojo'); | |
| 7 | |
| 8 var error; | 5 var error; |
| 9 | 6 |
| 10 geolocationServiceMock.then(mock => { | 7 geolocationServiceMock.then(mock => { |
| 11 mock.setGeolocationPermission(true); | 8 mock.setGeolocationPermission(true); |
| 12 mock.setGeolocationPositionUnavailableError(mockMessage); | 9 mock.setGeolocationPositionUnavailableError(mockMessage); |
| 13 | 10 |
| 14 var errorCallbackInvoked = false; | 11 var errorCallbackInvoked = false; |
| 15 navigator.geolocation.getCurrentPosition(function(p) { | 12 navigator.geolocation.getCurrentPosition(function(p) { |
| 16 testFailed('Success callback invoked unexpectedly'); | 13 testFailed('Success callback invoked unexpectedly'); |
| 17 finishJSTest(); | 14 finishJSTest(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 }, function(e) { | 37 }, function(e) { |
| 41 error = e; | 38 error = e; |
| 42 shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); | 39 shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); |
| 43 shouldBe('error.message', 'mockMessage'); | 40 shouldBe('error.message', 'mockMessage'); |
| 44 finishJSTest(); | 41 finishJSTest(); |
| 45 }); | 42 }); |
| 46 } | 43 } |
| 47 }); | 44 }); |
| 48 | 45 |
| 49 window.jsTestIsAsync = true; | 46 window.jsTestIsAsync = true; |
| OLD | NEW |