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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js

Issue 1367853002: Move GeolocationDispatcher into blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js
index 41b7d0a6d164d9a2fe2e5bd6b46c72b8ced64a91..b529edf2ef82c88aa16f2fb4ae71bd5f0b0814b9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js
@@ -34,11 +34,17 @@ function getPosition(milliseconds) {
setTimeout(fn, milliseconds);
}
-// The test terminates at the 3rd reported callback. If the bug still exists
-// this happens after the 2nd call to getCurrentPosition, one of them is a
-// repeat of the first.
-getPosition(0);
-getPosition(100);
-getPosition(200);
+// Make a geolocation request to populate the cached value so requests with a
+// timeout of 0 can succeed.
+navigator.geolocation.getCurrentPosition(function(position) {
+ // The test terminates at the 3rd reported callback. If the bug still exists
+ // this happens after the 2nd call to getCurrentPosition, one of them is a
+ // repeat of the first.
+ getPosition(0);
+ getPosition(100);
+ getPosition(200);
+}, function(error) {
+ testFailed('Error callback invoked unexpectedly');
+});
window.jsTestIsAsync = true;

Powered by Google App Engine
This is Rietveld 408576698