| <script src="../http/tests/inspector/inspector-test.js"></script> |
| var mockLatitude = 51.478; |
| var mockLongitude = -0.166; |
| testRunner.setGeolocationPermission(true); |
| testRunner.setMockGeolocationPosition(mockLatitude, |
| debug('This test can not be run without the LayoutTestController'); |
| function getGeolocation() |
| function printLocation(pos) |
| console.log('lat: ' + pos.coords.latitude + ', long: ' + pos.coords.longitude); |
| console.log('Error: ' + err.code); |
| navigator.geolocation.getCurrentPosition(printLocation, printError, []) |
| function callbackComplete() |
| InspectorTest.completeTest(); |
| PageAgent.clearGeolocationOverride(); |
| InspectorTest.evaluateInPage("getGeolocation()", callbackComplete); |
| PageAgent.setGeolocationOverride(43.476093, -80.540299, 150); |
| InspectorTest.evaluateInPage("getGeolocation()", callback); |
| <body onload="runTest()"> |