OLD | NEW |
(Empty) | |
| 1 description("Tests Geolocation when the permission service connection fails."); |
| 2 |
| 3 if (!window.testRunner || !window.mojo) |
| 4 debug('This test can not run without testRunner or mojo'); |
| 5 |
| 6 var error; |
| 7 |
| 8 geolocationServiceMock.then(mock => { |
| 9 |
| 10 mock.rejectPermissionConnections(); |
| 11 mock.setGeolocationPermission(false); |
| 12 mock.setGeolocationPosition(51.478, -0.166, 100.0); |
| 13 |
| 14 navigator.geolocation.getCurrentPosition(function(p) { |
| 15 testFailed('Success callback invoked unexpectedly'); |
| 16 finishJSTest(); |
| 17 }, function(e) { |
| 18 error = e; |
| 19 shouldBe('error.code', 'error.PERMISSION_DENIED'); |
| 20 shouldBe('error.message', '"User denied Geolocation"'); |
| 21 finishJSTest(); |
| 22 }); |
| 23 }); |
| 24 |
| 25 window.jsTestIsAsync = true; |
OLD | NEW |