Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: LayoutTests/inspector/geolocation-emulation/emulate-geolocation-invalid-params.html

Issue 172393006: LayoutTest emulating geolocation with inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update review comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function testLocationMock()
7 {
8 function testSuccess(position)
9 {
10 if (position.message) console.log("Error " + position.message)
11 else console.log("Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude);
12 }
13
14 function testFailed()
15 {
16 console.log("Unexpected error occured. Test failed.");
17 }
18
19 var mockLatitude = 100;
20 var mockLongitude = 200;
21 var mockAccuracy = 94;
22
23 internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mock Accuracy);
24 navigator.geolocation.getCurrentPosition(testSuccess, testFailed);
25 }
26
27 function setup()
28 {
29 if (window.internals) {
30 internals.setGeolocationClientMock(document);
31 internals.setGeolocationPermission(document, true);
32 }
33 }
34
35 function test()
36 {
37 InspectorTest.runTestSuite([
38 function setUp(next)
39 {
40 InspectorTest.evaluateInPage("setup()", next);
41 },
42
43 function setOverride(next)
44 {
45 InspectorTest.addConsoleSniffer(next);
46 // Invalid position params
47 GeolocationAgent.setGeolocationOverride(false, 0, 0);
48 GeolocationAgent.setGeolocationOverride(0, null, 0);
49 GeolocationAgent.setGeolocationOverride(0, 0, "test");
50 InspectorTest.evaluateInPage("testLocationMock()", next);
51 },
52
53 function clearOverride(next)
54 {
55 GeolocationAgent.clearGeolocationOverride(next);
56 }
57 ]);
58 }
59 </script>
60 </head>
61 <body onload="runTest()">
62 <p>
63 Tests that geolocation emulation with latitude and longitude works as expected.
64 </p>
65 </body>
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698