1 description("Tests that when a position is available, no callbacks are invoked until permission is denied.");
3 if (!window
.testRunner
|| !window
.internals
)
4 debug('This test can not run without testRunner or internals');
6 internals
.setGeolocationClientMock(document
);
7 internals
.setGeolocationPosition(document
, 51.478, -0.166, 100);
9 var permissionSet
= false;
11 function denyPermission() {
13 internals
.setGeolocationPermission(document
, false);
17 navigator
.geolocation
.getCurrentPosition(function() {
18 testFailed('Success callback invoked unexpectedly');
23 shouldBe('error.code', 'error.PERMISSION_DENIED');
24 shouldBe('error.message', '"User denied Geolocation"');
28 testFailed('Error callback invoked unexpectedly');
31 window
.setTimeout(denyPermission
, 100);
33 window
.jsTestIsAsync
= true;