| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function serializeGeolocationError(error) { | 6 function serializeGeolocationError(error) { |
| 7 var result = "Unknown error" | 7 var result = "Unknown error" |
| 8 switch (error.code) | 8 switch (error.code) |
| 9 { | 9 { |
| 10 case error.PERMISSION_DENIED: | 10 case error.PERMISSION_DENIED: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 navigator.geolocation.getCurrentPosition(testSuccess, testFailed); | 58 navigator.geolocation.getCurrentPosition(testSuccess, testFailed); |
| 59 } | 59 } |
| 60 | 60 |
| 61 function test() | 61 function test() |
| 62 { | 62 { |
| 63 InspectorTest.runTestSuite([ | 63 InspectorTest.runTestSuite([ |
| 64 function testGeolocationUnavailable(next) | 64 function testGeolocationUnavailable(next) |
| 65 { | 65 { |
| 66 InspectorTest.PageAgent.setGeolocationOverride(); | 66 InspectorTest.EmulationAgent.setGeolocationOverride(); |
| 67 InspectorTest.addConsoleSniffer(next); | 67 InspectorTest.addConsoleSniffer(next); |
| 68 InspectorTest.evaluateInPage("overrideGeolocation()"); | 68 InspectorTest.evaluateInPage("overrideGeolocation()"); |
| 69 }, | 69 }, |
| 70 | 70 |
| 71 function testOverridenGeolocation(next) | 71 function testOverridenGeolocation(next) |
| 72 { | 72 { |
| 73 InspectorTest.PageAgent.setGeolocationOverride(50, 100, 95); | 73 InspectorTest.EmulationAgent.setGeolocationOverride(50, 100, 95); |
| 74 InspectorTest.addConsoleSniffer(next); | 74 InspectorTest.addConsoleSniffer(next); |
| 75 InspectorTest.evaluateInPage("overrideGeolocation()"); | 75 InspectorTest.evaluateInPage("overrideGeolocation()"); |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 function testInvalidParam(next) | 78 function testInvalidParam(next) |
| 79 { | 79 { |
| 80 InspectorTest.PageAgent.setGeolocationOverride(true, 100, 95); | 80 InspectorTest.EmulationAgent.setGeolocationOverride(true, 100, 95); |
| 81 next(); | 81 next(); |
| 82 }, | 82 }, |
| 83 | 83 |
| 84 function testInvalidGeolocation(next) | 84 function testInvalidGeolocation(next) |
| 85 { | 85 { |
| 86 InspectorTest.PageAgent.setGeolocationOverride(200, 300, 95); | 86 InspectorTest.EmulationAgent.setGeolocationOverride(200, 300, 95); |
| 87 InspectorTest.addConsoleSniffer(next); | 87 InspectorTest.addConsoleSniffer(next); |
| 88 InspectorTest.evaluateInPage("overrideGeolocation()"); | 88 InspectorTest.evaluateInPage("overrideGeolocation()"); |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 function testTimestampOfOverridenPosition(next) | 91 function testTimestampOfOverridenPosition(next) |
| 92 { | 92 { |
| 93 InspectorTest.PageAgent.setGeolocationOverride(50, 100, 95); | 93 InspectorTest.EmulationAgent.setGeolocationOverride(50, 100, 95); |
| 94 InspectorTest.addConsoleSniffer(next); | 94 InspectorTest.addConsoleSniffer(next); |
| 95 InspectorTest.evaluateInPage("overridenTimestampGeolocation()"); | 95 InspectorTest.evaluateInPage("overridenTimestampGeolocation()"); |
| 96 } | 96 } |
| 97 ]); | 97 ]); |
| 98 } | 98 } |
| 99 </script> | 99 </script> |
| 100 </head> | 100 </head> |
| 101 <body onload="runTest()"> | 101 <body onload="runTest()"> |
| 102 <p> | 102 <p> |
| 103 Tests that geolocation emulation with latitude and longitude works as expected. | 103 Tests that geolocation emulation with latitude and longitude works as expected. |
| 104 </p> | 104 </p> |
| 105 </body> | 105 </body> |
| 106 </html> | 106 </html> |
| OLD | NEW |