OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 <script src="../../../resources/mojo-helpers.js"></script> | |
6 <script src="resources/geolocation-mock.js"></script> | |
7 </head> | |
8 <body> | |
9 <script> | |
10 description("Tests Geolocation when permission is denied, using the mock service
."); | |
11 | |
12 var error; | |
13 | |
14 geolocationServiceMock.then(mock => { | |
15 | |
16 mock.setGeolocationPermission(false); | |
17 mock.setGeolocationPosition(51.478, -0.166, 100.0); | |
18 | |
19 navigator.geolocation.getCurrentPosition(function(p) { | |
20 testFailed('Success callback invoked unexpectedly'); | |
21 finishJSTest(); | |
22 }, function(e) { | |
23 error = e; | |
24 shouldBe('error.code', 'error.PERMISSION_DENIED'); | |
25 shouldBe('error.message', '"User denied Geolocation"'); | |
26 finishJSTest(); | |
27 }); | |
28 }); | |
29 | |
30 window.jsTestIsAsync = true; | |
31 </script> | |
32 </body> | |
33 </html> | |
OLD | NEW |