3 <script src="../http/tests/inspector/inspector-test.js"></script>
6 var mockLatitude = 51.478;
7 var mockLongitude = -0.166;
8 var mockAccuracy = 100;
10 if (window.testRunner) {
11 testRunner.setGeolocationPermission(true);
12 testRunner.setMockGeolocationPosition(mockLatitude,
16 debug('This test can not be run without the LayoutTestController');
18 function getGeolocation()
20 function printLocation(pos)
22 console.log('lat: ' + pos.coords.latitude + ', long: ' + pos.coords.longitude);
24 function printError(err)
26 console.log('Error: ' + err.code);
28 navigator.geolocation.getCurrentPosition(printLocation, printError, [])
33 function callbackComplete()
35 InspectorTest.completeTest();
39 PageAgent.clearGeolocationOverride();
40 InspectorTest.evaluateInPage("getGeolocation()", callbackComplete);
42 PageAgent.setGeolocationOverride(43.476093, -80.540299, 150);
43 InspectorTest.evaluateInPage("getGeolocation()", callback);
50 <body onload="runTest()">