blob: f740d6e9cb3ecd40bfcca448531d8cfdac786c0c [file] [log] [blame]
[email protected]5acff60d2009-09-08 15:43:321<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
tkentc5e88f02017-02-06 22:47:314<script src="../resources/js-test.js"></script>
Reilly Grantbe310ab2017-07-11 01:51:265<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
6<script src="file:///gen/device/geolocation/public/interfaces/geolocation.mojom.js"></script>
7<script src="file:///gen/third_party/WebKit/public/platform/modules/permissions/permission.mojom.js"></script>
sammce6687802016-05-13 04:06:578<script src="resources/geolocation-mock.js"></script>
[email protected]5acff60d2009-09-08 15:43:329</head>
10<body>
tkent98122ee2017-02-02 07:38:5111<script>
12description("Tests Geolocation when permission is denied, using the mock service.");
13
14var error;
15
Reilly Grantbe310ab2017-07-11 01:51:2616let mock = geolocationMock;
17mock.setGeolocationPermission(false);
18mock.setGeolocationPosition(51.478, -0.166, 100.0);
tkent98122ee2017-02-02 07:38:5119
Reilly Grantbe310ab2017-07-11 01:51:2620navigator.geolocation.getCurrentPosition(function(p) {
21 testFailed('Success callback invoked unexpectedly');
22 finishJSTest();
23}, function(e) {
24 error = e;
25 shouldBe('error.code', 'error.PERMISSION_DENIED');
26 shouldBe('error.message', '"User denied Geolocation"');
27 finishJSTest();
tkent98122ee2017-02-02 07:38:5128});
29
30window.jsTestIsAsync = true;
31</script>
[email protected]5acff60d2009-09-08 15:43:3232</body>
33</html>