Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/watchPosition-page-visibility.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watchPosition-page-visibility.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watchPosition-page-visibility.html |
deleted file mode 100644 |
index 505de6f34c8fee260e9f5cb1195fb6602152f291..0000000000000000000000000000000000000000 |
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watchPosition-page-visibility.html |
+++ /dev/null |
@@ -1,89 +0,0 @@ |
-<!DOCTYPE html> |
-<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 watchPosition does not report position changes when the page is not visible."); |
-window.jsTestIsAsync = true; |
- |
-if (!window.testRunner) |
- debug('This test can not run without testRunner'); |
- |
-var position; |
-var error; |
-var isPageVisible = true; |
- |
-geolocationServiceMock.then(mock => { |
- mock.setGeolocationPermission(true); |
- |
- debug("* Page is visible"); |
- |
- var mockLatitude = 51.478; |
- var mockLongitude = -0.166; |
- var mockAccuracy = 100.0; |
- |
- function updatePosition() { |
- if (!window.testRunner) |
- return; |
- ++mockLatitude; |
- ++mockLongitude; |
- mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); |
- debug('device moved to (' + mockLatitude + ', ' + mockLongitude + ')'); |
- } |
- |
- updatePosition(); |
- |
- var state = 0; |
- |
- function checkPosition(p) { |
- position = p; |
- shouldBe('position.coords.latitude', '' + mockLatitude); |
- shouldBe('position.coords.longitude', '' + mockLongitude); |
- debug(''); |
- } |
- |
- function showPageAndUpdatePosition() { |
- shouldBeFalse('isPageVisible'); |
- debug(''); |
- state++; |
- if (window.testRunner) { |
- debug("*Showing page"); |
- testRunner.setPageVisibility("visible"); |
- isPageVisible = true; |
- } |
- updatePosition(); |
- } |
- |
- navigator.geolocation.watchPosition(function(p) { |
- debug("Page is notified of the position change"); |
- shouldBeTrue('isPageVisible'); |
- state++; |
- checkPosition(p); |
- switch(state) { |
- case 2: { |
- if (window.testRunner) { |
- debug("* Hiding page"); |
- testRunner.setPageVisibility("hidden"); |
- isPageVisible = false; |
- } |
- setTimeout(showPageAndUpdatePosition, 100); |
- break; |
- } |
- case 4: |
- finishJSTest(); |
- return; |
- } |
- updatePosition(); |
- }, function(e) { |
- testFailed('Error callback invoked unexpectedly'); |
- finishJSTest(); |
- }); |
-}); |
- |
-</script> |
-</body> |
-</html> |