1 description("Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK.");
3 if (!window.testRunner || !window.internals)
4 debug('This test can not run without testRunner or internals');
6 internals.setGeolocationClientMock(document);
7 internals.setGeolocationPermission(document, false);
8 internals.setGeolocationPosition(document, 51.478, -0.166, 100.0);
11 function checkPermissionError(e) {
13 shouldBe('error.code', 'error.PERMISSION_DENIED');
14 shouldBe('error.message', '"User denied Geolocation"');
17 var errorCallbackInvoked = false;
18 navigator.geolocation.getCurrentPosition(function(p) {
19 testFailed('Success callback invoked unexpectedly');
22 if (errorCallbackInvoked) {
23 testFailed('Error callback invoked unexpectedly');
26 errorCallbackInvoked = true;
27 checkPermissionError(e);
31 function continueTest() {
32 navigator.geolocation.getCurrentPosition(function(p) {
33 testFailed('Success callback invoked unexpectedly');
36 checkPermissionError(e);
41 window.jsTestIsAsync = true;