1 description("Tests that when a position is available, no callbacks are invoked until permission is allowed.");
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 allowPermission() {
13 internals
.setGeolocationPermission(document
, true);
16 navigator
.geolocation
.getCurrentPosition(function() {
18 testPassed('Success callback invoked');
22 testFailed('Success callback invoked unexpectedly');
25 testFailed('Error callback invoked unexpectedly');
28 window
.setTimeout(allowPermission
, 100);
30 window
.jsTestIsAsync
= true;