Title: [171836] trunk/LayoutTests
Revision
171836
Author
[email protected]
Date
2014-07-30 20:19:12 -0700 (Wed, 30 Jul 2014)

Log Message

Add a layout test for Geolocation's request queueing for hidden pages
https://bugs.webkit.org/show_bug.cgi?id=135402

Patch by Benjamin Poulain <[email protected]> on 2014-07-30
Reviewed by Zalan Bujtas.

Sam added the queueing feature in r171188. This patch adds a layout test
for the simplest case.

* fast/dom/Geolocation/requestQueuingForHiddenPage-expected.txt: Added.
* fast/dom/Geolocation/requestQueuingForHiddenPage.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (171835 => 171836)


--- trunk/LayoutTests/ChangeLog	2014-07-31 03:18:40 UTC (rev 171835)
+++ trunk/LayoutTests/ChangeLog	2014-07-31 03:19:12 UTC (rev 171836)
@@ -1,3 +1,16 @@
+2014-07-30  Benjamin Poulain  <[email protected]>
+
+        Add a layout test for Geolocation's request queueing for hidden pages
+        https://bugs.webkit.org/show_bug.cgi?id=135402
+
+        Reviewed by Zalan Bujtas.
+
+        Sam added the queueing feature in r171188. This patch adds a layout test
+        for the simplest case.
+
+        * fast/dom/Geolocation/requestQueuingForHiddenPage-expected.txt: Added.
+        * fast/dom/Geolocation/requestQueuingForHiddenPage.html: Added.
+
 2014-07-30  Pratik Solanki  <[email protected]>
 
         Move iphone-simulator test results landed in r171094 to the correct directory.

Added: trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage-expected.txt (0 => 171836)


--- trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage-expected.txt	2014-07-31 03:19:12 UTC (rev 171836)
@@ -0,0 +1,10 @@
+Tests that we do not process Geolocation request until the page become visible. Once the page becomes visible, the request should go through. This test cannot be run manually, it relies on the testRunner.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS The geolocation request was processed after the page became visible.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage.html (0 => 171836)


--- trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Geolocation/requestQueuingForHiddenPage.html	2014-07-31 03:19:12 UTC (rev 171836)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+description("Tests that we do not process Geolocation request until the page become visible. Once the page becomes visible, the request should go through. This test cannot be run manually, it relies on the testRunner.");
+window.jsTestIsAsync = true;
+
+var testingPhase = "initialization";
+
+function geolocationWatchFunction()
+{
+    if (testingPhase === "initialization")
+        testFailed("The geolocation request was processed while the page was still hidden.");
+    else
+        testPassed("The geolocation request was processed after the page became visible.");
+
+    finishJSTest();
+}
+
+function onVisibilityChange() {
+    if (document.hidden) {
+        navigator.geolocation.watchPosition(geolocationWatchFunction);
+        setTimeout(function() {
+             testingPhase = "changing page to visible";
+             testRunner.setPageVisibility("visible");
+        }, 15);
+    }
+}
+
+document.addEventListener("visibilitychange", onVisibilityChange, false)
+
+if (window.testRunner) {
+    testRunner.setPageVisibility("hidden");
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPosition(1, 2, 3);
+}
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to