|  | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 
|  | <html> | 
|  | <head> | 
|  | <script src="../resources/js-test.js"></script> | 
|  | <script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script> | 
|  | <script src="file:///gen/device/geolocation/public/interfaces/geolocation.mojom.js"></script> | 
|  | <script src="file:///gen/third_party/blink/public/platform/modules/geolocation/geolocation_service.mojom.js"></script> | 
|  | <script src="file:///gen/third_party/blink/public/platform/modules/permissions/permission.mojom.js"></script> | 
|  | <script src="resources/geolocation-mock.js"></script> | 
|  | </head> | 
|  | <body> | 
|  | <script> | 
|  | description("Tests that when timeout is negative (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); | 
|  |  | 
|  | var error; | 
|  |  | 
|  | let mock = geolocationMock; | 
|  | mock.setGeolocationPosition(51.478, -0.166, 100.0); | 
|  |  | 
|  | navigator.geolocation.getCurrentPosition(function(p) { | 
|  | testFailed('Success callback invoked unexpectedly'); | 
|  | finishJSTest(); | 
|  | }, function(e) { | 
|  | error = e; | 
|  | shouldBe('error.code', 'error.TIMEOUT'); | 
|  | shouldBe('error.message', '"Timeout expired"'); | 
|  | finishJSTest(); | 
|  | }, { | 
|  | timeout: -1000 | 
|  | }); | 
|  |  | 
|  | window.jsTestIsAsync = true; | 
|  |  | 
|  | </script> | 
|  | </body> | 
|  | </html> |