| OLD | NEW |
| 1 description("Tests that when Geolocation permission is denied, watches are stopp
ed, as well as one-shots."); | 1 description("Tests that when Geolocation permission is denied, watches are stopp
ed, as well as one-shots."); |
| 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 | 6 |
| 10 // Configure the mock Geolocation service to report a position to cause perm
ission | 7 // Configure the mock Geolocation service to report a position to cause perm
ission |
| 11 // to be requested, then deny it. | 8 // to be requested, then deny it. |
| 12 mock.setGeolocationPermission(false); | 9 mock.setGeolocationPermission(false); |
| 13 mock.setGeolocationPosition(51.478, -0.166, 100.0); | 10 mock.setGeolocationPosition(51.478, -0.166, 100.0); |
| 14 | 11 |
| 15 var errorCallbackInvoked = false; | 12 var errorCallbackInvoked = false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 28 shouldBe('error.message', '"User denied Geolocation"'); | 25 shouldBe('error.message', '"User denied Geolocation"'); |
| 29 | 26 |
| 30 // Update the mock Geolocation service to report a new position, then | 27 // Update the mock Geolocation service to report a new position, then |
| 31 // yield to allow a chance for the success callback to be invoked. | 28 // yield to allow a chance for the success callback to be invoked. |
| 32 mock.setGeolocationPosition(55.478, -0.166, 100); | 29 mock.setGeolocationPosition(55.478, -0.166, 100); |
| 33 window.setTimeout(finishJSTest, 0); | 30 window.setTimeout(finishJSTest, 0); |
| 34 }); | 31 }); |
| 35 }); | 32 }); |
| 36 | 33 |
| 37 window.jsTestIsAsync = true; | 34 window.jsTestIsAsync = true; |
| OLD | NEW |