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

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

Issue 2671933003: Move Geolocation out from fast/dom. (Closed)
Patch Set: . Created 3 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
Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html
deleted file mode 100644
index 56022d002af52dfb28c8475aad8563a78e70c5d5..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../../resources/js-test.js"></script>
-<script src="../../../resources/mojo-helpers.js"></script>
-<script src="resources/geolocation-mock.js"></script>
-</head>
-<body>
-<script>
-description('Tests that when a cached position is available the callback for getCurrentPosition is called only once. This is a regression test for http://crbug.com/311876 .');
-
-// Only one success callback should be reported per call to getCurrentPosition.
-var reportCount = 0;
-var isSuccess;
-
-function reportCallback(success, id) {
- isSuccess = success;
- shouldBeTrue('isSuccess');
- getCurrentPositionCallId = id;
- shouldBe('getCurrentPositionCallId', 'reportCount');
- if (++reportCount >= 3)
- finishJSTest();
-}
-
-var getCurrentPositionCall = 0;
-function getPosition(milliseconds) {
- var id = getCurrentPositionCall++;
- var fn = function() {
- navigator.geolocation.getCurrentPosition(
- function(position) {
- reportCallback(true, id);
- },
- function(error) {
- reportCallback(false, id);
- },
- { maximumAge:600000, timeout:0 });
- };
- setTimeout(fn, milliseconds);
-}
-
-geolocationServiceMock.then(mock => {
- mock.setGeolocationPosition(31.478, -0.166, 100);
- mock.setGeolocationPermission(true);
-
- // 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;
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698