1 description("Tests Geolocation error callback using the mock service.");
3 var mockMessage = "debug";
5 if (!window.testRunner || !window.internals)
6 debug('This test can not run without testRunner or internals');
8 internals.setGeolocationClientMock(document);
9 internals.setGeolocationPermission(document, true);
10 internals.setGeolocationPositionUnavailableError(document, mockMessage);
13 navigator.geolocation.getCurrentPosition(function(p) {
14 testFailed('Success callback invoked unexpectedly');
18 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
19 shouldBe('error.message', 'mockMessage');
20 shouldBe('error.UNKNOWN_ERROR', 'undefined');
21 shouldBe('error.PERMISSION_DENIED', '1');
22 shouldBe('error.POSITION_UNAVAILABLE', '2');
23 shouldBe('error.TIMEOUT', '3');
27 window.jsTestIsAsync = true;