| OLD | NEW |
| 1 description("Tests that reentrant calls to Geolocation methods from the error ca
llback due to a PERMISSION_DENIED error are OK."); | 1 description("Tests that reentrant calls to Geolocation methods from the error ca
llback due to a PERMISSION_DENIED error are OK."); |
| 2 | 2 |
| 3 if (!window.testRunner || !window.mojo) | |
| 4 debug('This test can not run without testRunner or mojo'); | |
| 5 | |
| 6 var error; | 3 var error; |
| 7 | 4 |
| 8 geolocationServiceMock.then(mock => { | 5 geolocationServiceMock.then(mock => { |
| 9 mock.setGeolocationPermission(false); | 6 mock.setGeolocationPermission(false); |
| 10 mock.setGeolocationPosition(51.478, -0.166, 100.0); | 7 mock.setGeolocationPosition(51.478, -0.166, 100.0); |
| 11 | 8 |
| 12 function checkPermissionError(e) { | 9 function checkPermissionError(e) { |
| 13 error = e; | 10 error = e; |
| 14 shouldBe('error.code', 'error.PERMISSION_DENIED'); | 11 shouldBe('error.code', 'error.PERMISSION_DENIED'); |
| 15 shouldBe('error.message', '"User denied Geolocation"'); | 12 shouldBe('error.message', '"User denied Geolocation"'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 34 testFailed('Success callback invoked unexpectedly'); | 31 testFailed('Success callback invoked unexpectedly'); |
| 35 finishJSTest(); | 32 finishJSTest(); |
| 36 }, function(e) { | 33 }, function(e) { |
| 37 checkPermissionError(e); | 34 checkPermissionError(e); |
| 38 finishJSTest(); | 35 finishJSTest(); |
| 39 }); | 36 }); |
| 40 } | 37 } |
| 41 }); | 38 }); |
| 42 | 39 |
| 43 window.jsTestIsAsync = true; | 40 window.jsTestIsAsync = true; |
| OLD | NEW |