| OLD | NEW |
| 1 description("Tests that when a position is available, no callbacks are invoked u
ntil permission is denied."); | 1 description("Tests that when a position is available, no callbacks are invoked u
ntil permission is denied."); |
| 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.setGeolocationPosition(51.478, -0.166, 100); | 6 mock.setGeolocationPosition(51.478, -0.166, 100); |
| 10 | 7 |
| 11 var permissionSet = false; | 8 var permissionSet = false; |
| 12 | 9 |
| 13 function denyPermission() { | 10 function denyPermission() { |
| 14 permissionSet = true; | 11 permissionSet = true; |
| 15 mock.setGeolocationPermission(false); | 12 mock.setGeolocationPermission(false); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 26 finishJSTest(); | 23 finishJSTest(); |
| 27 return; | 24 return; |
| 28 } | 25 } |
| 29 testFailed('Error callback invoked unexpectedly'); | 26 testFailed('Error callback invoked unexpectedly'); |
| 30 finishJSTest(); | 27 finishJSTest(); |
| 31 }); | 28 }); |
| 32 window.setTimeout(denyPermission, 100); | 29 window.setTimeout(denyPermission, 100); |
| 33 }); | 30 }); |
| 34 | 31 |
| 35 window.jsTestIsAsync = true; | 32 window.jsTestIsAsync = true; |
| OLD | NEW |