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

Unified Diff: LayoutTests/inspector/geolocation-emulation-tests.html

Issue 143003024: Fix geolocation timestamp to return in milliseconds when emulating in inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/geolocation-emulation-tests-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/geolocation-emulation-tests.html
diff --git a/LayoutTests/inspector/geolocation-emulation-tests.html b/LayoutTests/inspector/geolocation-emulation-tests.html
index 3efa4c5a115c0cdf417a96ce8cb240cb9335b764..850d9a998828b04c36fa1b246a3ac81d610e6bc8 100644
--- a/LayoutTests/inspector/geolocation-emulation-tests.html
+++ b/LayoutTests/inspector/geolocation-emulation-tests.html
@@ -18,21 +18,37 @@ function overrideGeolocation()
console.log(error.message);
}
- var mockLatitude = 100;
- var mockLongitude = 200;
- var mockAccuracy = 94;
+ navigator.geolocation.getCurrentPosition(testSuccess, testFailed);
+}
- if (window.internals)
- internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mockAccuracy);
+function overridenTimestampGeolocation()
+{
+ function testSuccess(position)
+ {
+ if ((new Date(position.timestamp)).toDateString() == (new Date()).toDateString())
+ console.log("PASSED");
+ else
+ console.log("Unexpected error occured. Test failed.");
+ }
+
+ function testFailed(error)
+ {
+ console.log(error.message);
+ }
navigator.geolocation.getCurrentPosition(testSuccess, testFailed);
}
function setup()
{
+ var mockLatitude = 100;
+ var mockLongitude = 200;
+ var mockAccuracy = 94;
+
if (window.internals) {
internals.setGeolocationClientMock(document);
internals.setGeolocationPermission(document, true);
+ internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mockAccuracy);
}
}
@@ -70,6 +86,13 @@ function test()
{
GeolocationAgent.setGeolocationOverride(true, 500, 100);
next();
+ },
+
+ function testTimestampOfOverridenPosition(next)
+ {
+ GeolocationAgent.setGeolocationOverride(-510, 500, 100);
+ InspectorTest.addConsoleSniffer(next);
+ InspectorTest.evaluateInPage("overridenTimestampGeolocation()");
}
]);
}
« no previous file with comments | « no previous file | LayoutTests/inspector/geolocation-emulation-tests-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698