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

Side by Side Diff: LayoutTests/inspector/geolocation-emulation/emulate-geolocation-unavailable.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()
9 {
10 console.log("Unexpected error occured. Test failed.");
11 }
12
13 function testFailed()
14 {
15 console.log("PASSED.");
16 }
17
18 var mockLatitude = 100;
19 var mockLongitude = 200;
20 var mockAccuracy = 94;
21
22 if (window.internals) {
23 internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mockAccuracy);
24 navigator.geolocation.getCurrentPosition(testSuccess, testFailed);
25 }
26 }
27
28 function setup()
29 {
30 if (window.internals) {
31 internals.setGeolocationClientMock(document);
32 internals.setGeolocationPermission(document, true);
33 }
34 }
35
36 function test()
37 {
38 InspectorTest.runTestSuite([
39 function setUp(next)
40 {
41 InspectorTest.evaluateInPage("setup()", next);
42 },
43
44 function setOverride(next)
45 {
46 InspectorTest.addConsoleSniffer(next);
47 GeolocationAgent.setGeolocationOverride();
48 InspectorTest.evaluateInPage("testLocationMock()", next);
49 },
50
51 function clearOverride(next)
52 {
53 GeolocationAgent.clearGeolocationOverride(next);
54 }
55 ]);
56 }
57 </script>
58 </head>
59 <body onload="runTest()">
60 <p>
61 Tests that geolocation emulation with latitude and longitude works as expected.
62 </p>
63 </body>
64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698