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