Title: [251402] trunk/LayoutTests
Revision
251402
Author
commit-qu...@webkit.org
Date
2019-10-21 17:43:07 -0700 (Mon, 21 Oct 2019)

Log Message

http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=202852
<rdar://problem/56195888>

Patch by Kate Cheney <katherine_che...@apple.com> on 2019-10-21
Reviewed by Alex Christensen.

Fixed test flakiness caused by the resource remaining in the cache
between tests, therefore not creating a new isolated session and
failing the text diff. This patch adds a php header to each file to
prevent the resource from being stored in the cache.

* http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html.
* http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html.
* http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html.
* http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (251401 => 251402)


--- trunk/LayoutTests/ChangeLog	2019-10-22 00:22:09 UTC (rev 251401)
+++ trunk/LayoutTests/ChangeLog	2019-10-22 00:43:07 UTC (rev 251402)
@@ -1,3 +1,21 @@
+2019-10-21  Kate Cheney  <katherine_che...@apple.com>
+
+        http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=202852
+        <rdar://problem/56195888>
+
+        Reviewed by Alex Christensen.
+
+        Fixed test flakiness caused by the resource remaining in the cache
+        between tests, therefore not creating a new isolated session and
+        failing the text diff. This patch adds a php header to each file to
+        prevent the resource from being stored in the cache.
+
+        * http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html.
+        * http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html.
+        * http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html.
+        * http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php: Renamed from LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html.
+
 2019-10-21  Truitt Savell  <tsav...@apple.com>
 
         [ Mac ] Layout Test legacy-animation-engine/compositing/backing/transform-transition-from-outside-view.html is flaky

Deleted: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html (251401 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html	2019-10-22 00:22:09 UTC (rev 251401)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html	2019-10-22 00:43:07 UTC (rev 251402)
@@ -1,110 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
-    jsTestIsAsync = true;
-
-    const prevalentOrigin = "http://127.0.0.1:8000";
-    const nonPrevalentOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn't have the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn't have but has the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn't have the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn't have but has the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "#step1":
-                setSessionCookie();
-                setPersistentCookie();
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
-                    testFailed("Origin has isolated session.");
-                    setEnableFeature(false, finishJSTest);
-                } else
-                    testPassed("Origin has no isolated session.");
-                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html#step2";
-                break;
-            case "#step2":
-                document.location.hash = "step3";
-                if (document.location.origin !== nonPrevalentOrigin)
-                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
-                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
-                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
-                        setEnableFeature(false, finishJSTest);
-                    }
-                    testRunner.statisticsUpdateCookieBlocking(runTest);
-                });
-                break;
-            case "#step3":
-                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html#step4";
-                break;
-            case "#step4":
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testFailed("Origin has isolated session.");
-                else
-                    testPassed("Origin has no isolated session.");
-                setEnableFeature(false, finishJSTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishJSTest);
-        }
-    }
-
-    if (document.location.hash === "") {
-        if (document.location.origin !== prevalentOrigin)
-            testFailed("Test is not starting out on " + prevalentOrigin + ".");
-            
-            testRunner.setUseITPDatabase(true);
-        setEnableFeature(true, function () {
-            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
-                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
-            document.location.hash = "step1";
-        });
-    }
-</script>
-</body>
-</html>

Copied: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php (from rev 251401, trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html) (0 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php	2019-10-22 00:43:07 UTC (rev 251402)
@@ -0,0 +1,113 @@
+<?php
+    header("Cache-Control: no-store");
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn't have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn't have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn't have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn't have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "#step1":
+                setSessionCookie();
+                setPersistentCookie();
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                    testFailed("Origin has isolated session.");
+                    setEnableFeature(false, finishJSTest);
+                } else
+                    testPassed("Origin has no isolated session.");
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php#step2";
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testFailed("Origin has isolated session.");
+                else
+                    testPassed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+
+    if (document.location.hash === "") {
+        if (document.location.origin !== prevalentOrigin)
+            testFailed("Test is not starting out on " + prevalentOrigin + ".");
+            
+            testRunner.setUseITPDatabase(true);
+        setEnableFeature(true, function () {
+            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+            document.location.hash = "step1";
+        });
+    }
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html (251401 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html	2019-10-22 00:22:09 UTC (rev 251401)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html	2019-10-22 00:43:07 UTC (rev 251402)
@@ -1,108 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
-    jsTestIsAsync = true;
-
-    const prevalentOrigin = "http://127.0.0.1:8000";
-    const nonPrevalentOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn't have the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn't have but has the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn't have the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn't have but has the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "#step1":
-                setSessionCookie();
-                setPersistentCookie();
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
-                    testFailed("Origin has isolated session.");
-                    setEnableFeature(false, finishJSTest);
-                } else
-                    testPassed("Origin has no isolated session.");
-                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html#step2";
-                break;
-            case "#step2":
-                document.location.hash = "step3";
-                if (document.location.origin !== nonPrevalentOrigin)
-                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
-                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
-                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
-                        setEnableFeature(false, finishJSTest);
-                    }
-                    testRunner.statisticsUpdateCookieBlocking(runTest);
-                });
-                break;
-            case "#step3":
-                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html#step4";
-                break;
-            case "#step4":
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testFailed("Origin has isolated session.");
-                else
-                    testPassed("Origin has no isolated session.");
-                setEnableFeature(false, finishJSTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishJSTest);
-        }
-    }
-
-    if (document.location.hash === "") {
-        if (document.location.origin !== prevalentOrigin)
-            testFailed("Test is not starting out on " + prevalentOrigin + ".");
-        setEnableFeature(true, function () {
-            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
-                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
-            document.location.hash = "step1";
-        });
-    }
-</script>
-</body>
-</html>

Copied: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php (from rev 251401, trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html) (0 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php	2019-10-22 00:43:07 UTC (rev 251402)
@@ -0,0 +1,111 @@
+<?php
+    header("Cache-Control: no-store");
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn't have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn't have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn't have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn't have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "#step1":
+                setSessionCookie();
+                setPersistentCookie();
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                    testFailed("Origin has isolated session.");
+                    setEnableFeature(false, finishJSTest);
+                } else
+                    testPassed("Origin has no isolated session.");
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php#step2";
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testFailed("Origin has isolated session.");
+                else
+                    testPassed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+
+    if (document.location.hash === "") {
+        if (document.location.origin !== prevalentOrigin)
+            testFailed("Test is not starting out on " + prevalentOrigin + ".");
+        setEnableFeature(true, function () {
+            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+            document.location.hash = "step1";
+        });
+    }
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html (251401 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html	2019-10-22 00:22:09 UTC (rev 251401)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html	2019-10-22 00:43:07 UTC (rev 251402)
@@ -1,111 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
-    jsTestIsAsync = true;
-
-    const prevalentOrigin = "http://127.0.0.1:8000";
-    const nonPrevalentOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn't have the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn't have but has the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn't have the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn't have but has the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "#step1":
-                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
-                    setSessionCookie();
-                    setPersistentCookie();
-                    checkCookies(true, true);
-                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
-                        testFailed("Origin has isolated session.");
-                        setEnableFeature(false, finishJSTest);
-                    } else
-                        testPassed("Origin has no isolated session.");
-                    document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html#step2";
-                });
-                break;
-            case "#step2":
-                document.location.hash = "step3";
-                if (document.location.origin !== nonPrevalentOrigin)
-                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
-                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
-                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
-                        setEnableFeature(false, finishJSTest);
-                    }
-                    testRunner.statisticsUpdateCookieBlocking(runTest);
-                });
-                break;
-            case "#step3":
-                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html#step4";
-                break;
-            case "#step4":
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testPassed("Origin has isolated session.");
-                else
-                    testFailed("Origin has no isolated session.");
-                setEnableFeature(false, finishJSTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishJSTest);
-        }
-    }
-
-    if (document.location.hash === "") {
-        if (document.location.origin !== prevalentOrigin)
-            testFailed("Test is not starting out on " + prevalentOrigin + ".");
-        testRunner.setUseITPDatabase(true);
-        setEnableFeature(true, function () {
-            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
-                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
-            document.location.hash = "step1";
-        });
-    }
-</script>
-</body>
-</html>

Copied: trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php (from rev 251401, trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html) (0 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php	2019-10-22 00:43:07 UTC (rev 251402)
@@ -0,0 +1,114 @@
+<?php
+    header("Cache-Control: no-store");
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn't have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn't have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn't have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn't have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "#step1":
+                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
+                    setSessionCookie();
+                    setPersistentCookie();
+                    checkCookies(true, true);
+                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                        testFailed("Origin has isolated session.");
+                        setEnableFeature(false, finishJSTest);
+                    } else
+                        testPassed("Origin has no isolated session.");
+                    document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php#step2";
+                });
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testPassed("Origin has isolated session.");
+                else
+                    testFailed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+
+    if (document.location.hash === "") {
+        if (document.location.origin !== prevalentOrigin)
+            testFailed("Test is not starting out on " + prevalentOrigin + ".");
+        testRunner.setUseITPDatabase(true);
+        setEnableFeature(true, function () {
+            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+            document.location.hash = "step1";
+        });
+    }
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html (251401 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html	2019-10-22 00:22:09 UTC (rev 251401)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html	2019-10-22 00:43:07 UTC (rev 251402)
@@ -1,110 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
-    jsTestIsAsync = true;
-
-    const prevalentOrigin = "http://127.0.0.1:8000";
-    const nonPrevalentOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn't have the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn't have but has the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn't have the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn't have but has the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "#step1":
-                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
-                    setSessionCookie();
-                    setPersistentCookie();
-                    checkCookies(true, true);
-                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
-                        testFailed("Origin has isolated session.");
-                        setEnableFeature(false, finishJSTest);
-                    } else
-                        testPassed("Origin has no isolated session.");
-                    document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html#step2";
-                });
-                break;
-            case "#step2":
-                document.location.hash = "step3";
-                if (document.location.origin !== nonPrevalentOrigin)
-                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
-                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
-                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
-                        setEnableFeature(false, finishJSTest);
-                    }
-                    testRunner.statisticsUpdateCookieBlocking(runTest);
-                });
-                break;
-            case "#step3":
-                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html#step4";
-                break;
-            case "#step4":
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testPassed("Origin has isolated session.");
-                else
-                    testFailed("Origin has no isolated session.");
-                setEnableFeature(false, finishJSTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishJSTest);
-        }
-    }
-
-    if (document.location.hash === "") {
-        if (document.location.origin !== prevalentOrigin)
-            testFailed("Test is not starting out on " + prevalentOrigin + ".");
-        setEnableFeature(true, function () {
-            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
-                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
-            document.location.hash = "step1";
-        });
-    }
-</script>
-</body>
-</html>

Copied: trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php (from rev 251401, trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html) (0 => 251402)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php	2019-10-22 00:43:07 UTC (rev 251402)
@@ -0,0 +1,113 @@
+<?php
+    header("Cache-Control: no-store");
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn't have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn't have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn't have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn't have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn't have and doesn't have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "#step1":
+                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
+                    setSessionCookie();
+                    setPersistentCookie();
+                    checkCookies(true, true);
+                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                        testFailed("Origin has isolated session.");
+                        setEnableFeature(false, finishJSTest);
+                    } else
+                        testPassed("Origin has no isolated session.");
+                    document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php#step2";
+                });
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testPassed("Origin has isolated session.");
+                else
+                    testFailed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+
+    if (document.location.hash === "") {
+        if (document.location.origin !== prevalentOrigin)
+            testFailed("Test is not starting out on " + prevalentOrigin + ".");
+        setEnableFeature(true, function () {
+            if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+            document.location.hash = "step1";
+        });
+    }
+</script>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to