[email protected] | 5acff60d | 2009-09-08 15:43:32 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <html> |
| 3 | <head> |
tkent | c5e88f0 | 2017-02-06 22:47:31 | [diff] [blame] | 4 | <script src="../resources/js-test.js"></script> |
Reilly Grant | be310ab | 2017-07-11 01:51:26 | [diff] [blame] | 5 | <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> |
sammc | e668780 | 2016-05-13 04:06:57 | [diff] [blame] | 8 | <script src="resources/geolocation-mock.js"></script> |
[email protected] | 5acff60d | 2009-09-08 15:43:32 | [diff] [blame] | 9 | </head> |
| 10 | <body> |
tkent | 98122ee | 2017-02-02 07:38:51 | [diff] [blame] | 11 | <script> |
| 12 | description("Tests Geolocation when permission is denied, using the mock service."); |
| 13 | |
| 14 | var error; |
| 15 | |
Reilly Grant | be310ab | 2017-07-11 01:51:26 | [diff] [blame] | 16 | let mock = geolocationMock; |
| 17 | mock.setGeolocationPermission(false); |
| 18 | mock.setGeolocationPosition(51.478, -0.166, 100.0); |
tkent | 98122ee | 2017-02-02 07:38:51 | [diff] [blame] | 19 | |
Reilly Grant | be310ab | 2017-07-11 01:51:26 | [diff] [blame] | 20 | navigator.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(); |
tkent | 98122ee | 2017-02-02 07:38:51 | [diff] [blame] | 28 | }); |
| 29 | |
| 30 | window.jsTestIsAsync = true; |
| 31 | </script> |
[email protected] | 5acff60d | 2009-09-08 15:43:32 | [diff] [blame] | 32 | </body> |
| 33 | </html> |