1description("Tests Geolocation when permission is denied, using the mock service."); 2 3window.layoutTestController.setGeolocationPermission(false); 4window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 5 6var error; 7navigator.geolocation.getCurrentPosition(function(p) { 8 testFailed('Success callback invoked unexpectedly'); 9 window.layoutTestController.notifyDone(); 10}, function(e) { 11 error = e 12 shouldBe('error.code', 'error.PERMISSION_DENIED'); 13 shouldBe('error.message', '"User denied Geolocation"'); 14 debug('<br /><span class="pass">TEST COMPLETE</span>'); 15 window.layoutTestController.notifyDone(); 16}); 17window.layoutTestController.waitUntilDone(); 18 19var isAsynchronous = true; 20var successfullyParsed = true; 21