Chromium Code Reviews| Index: LayoutTests/inspector/geolocation-emulation/emulate-geolocation-unavailable.html |
| diff --git a/LayoutTests/inspector/geolocation-emulation/emulate-geolocation-unavailable.html b/LayoutTests/inspector/geolocation-emulation/emulate-geolocation-unavailable.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..78a7113cfa45ee93dc3df13329f30b1630311209 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/geolocation-emulation/emulate-geolocation-unavailable.html |
| @@ -0,0 +1,64 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script> |
| + |
| +function testLocationMock() |
| +{ |
| + function testSuccess() |
| + { |
| + console.log("Unexpected error occured. Test failed."); |
| + } |
| + |
| + function testFailed() |
| + { |
| + console.log("PASSED."); |
| + } |
| + |
| + var mockLatitude = 100; |
| + var mockLongitude = 200; |
| + var mockAccuracy = 94; |
| + |
| + if (window.internals) { |
| + internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mockAccuracy); |
| + navigator.geolocation.getCurrentPosition(testSuccess, testFailed); |
| + } |
| +} |
| + |
| +function setup() |
| +{ |
| + if (window.internals) { |
| + internals.setGeolocationClientMock(document); |
| + internals.setGeolocationPermission(document, true); |
| + } |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.runTestSuite([ |
|
pfeldman
2014/02/20 11:38:42
These tests look great. But I'd rather place them
|
| + function setUp(next) |
| + { |
| + InspectorTest.evaluateInPage("setup()", next); |
| + }, |
| + |
| + function setOverride(next) |
| + { |
| + InspectorTest.addConsoleSniffer(next); |
| + GeolocationAgent.setGeolocationOverride(); |
| + InspectorTest.evaluateInPage("testLocationMock()", next); |
| + }, |
| + |
| + function clearOverride(next) |
| + { |
| + GeolocationAgent.clearGeolocationOverride(next); |
| + } |
| + ]); |
| +} |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p> |
| +Tests that geolocation emulation with latitude and longitude works as expected. |
| +</p> |
| +</body> |
| +</html> |