blob: 4ecf9c4b2df0a68dcc45b3d3e01774102e3aba4f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../resources/mojo-helpers.js"></script>
<script src="resources/geolocation-mock.js"></script>
</head>
<body>
<script>
description("Tests Geolocation when the geolocation service connection fails.");
var error;
geolocationServiceMock.then(mock => {
mock.setGeolocationPermission(true);
mock.rejectGeolocationConnections();
navigator.geolocation.getCurrentPosition(function(p) {
testFailed('Success callback invoked unexpectedly');
finishJSTest();
}, function(e) {
error = e;
shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
shouldBe('error.message', '"Failed to start Geolocation service"');
finishJSTest();
});
});
window.jsTestIsAsync = true;
</script>
</body>
</html>