Unreviewed, reverting r259440.
authortsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2020 22:04:26 +0000 (22:04 +0000)
committertsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2020 22:04:26 +0000 (22:04 +0000)
Introduced 2 failing tests on Mac and iOS

Reverted changeset:

"Add SPI to configure WebsiteDataStores with a URL for
standalone web applications and use it to disable first-party
website data removal in ITP"
https://bugs.webkit.org/show_bug.cgi?id=209634
https://trac.webkit.org/changeset/259440

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259516 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database-expected.txt [deleted file]
LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database.html [deleted file]
LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-expected.txt [deleted file]
LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html [deleted file]
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h
Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h
Source/WebKit/NetworkProcess/NetworkSession.cpp
Source/WebKit/NetworkProcess/NetworkSession.h
Source/WebKit/Shared/ResourceLoadStatisticsParameters.h
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestOptions.h
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

index 5a175a1..3b6b4aa 100644 (file)
@@ -1,3 +1,17 @@
+2020-04-03  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, reverting r259440.
+
+        Introduced 2 failing tests on Mac and iOS
+
+        Reverted changeset:
+
+        "Add SPI to configure WebsiteDataStores with a URL for
+        standalone web applications and use it to disable first-party
+        website data removal in ITP"
+        https://bugs.webkit.org/show_bug.cgi?id=209634
+        https://trac.webkit.org/changeset/259440
+
 2020-04-03  Ross Kirsling  <ross.kirsling@sony.com>
 
         Move Intl tests from LayoutTests to JSTests
diff --git a/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database-expected.txt b/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database-expected.txt
deleted file mode 100644 (file)
index 5b6a435..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Check that non-cookie website data does not get removed after a period of no user interaction if the website is a standalone web application.
-
-Before deletion: Client-side cookie exists.
-Before deletion: HttpOnly cookie exists.
-Before deletion: Regular server-side cookie exists.
-Before deletion: LocalStorage entry does exist.
-Before deletion: IDB entry does exist.
-
-After deletion: HttpOnly cookie exists.
-After deletion: Client-side cookie exists.
-After deletion: Regular server-side cookie exists.
-After deletion: LocalStorage entry does exist.
-After deletion: IDB entry does exist.
-
-
diff --git a/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database.html b/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database.html
deleted file mode 100644 (file)
index 64f6423..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-<!-- webkit-test-runner [ standaloneWebApplicationURL=http://127.0.0.1 ] -->
-<!DOCTYPE html>
-<html>
-<head>
-    <script src="/cookies/resources/cookie-utilities.js"></script>
-    <script src="resources/util.js"></script>
-</head>
-<body onload="setTimeout('runTest()', 0)">
-<div id="description">Check that non-cookie website data does not get removed after a period of no user interaction if the website is a standalone web application.</div>
-<br>
-<div id="output"></div>
-<br>
-<script>
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
-    testRunner.setUseITPDatabase(true);
-
-    const httpOnlyCookieName = "http-only-cookie";
-    const serverSideCookieName = "server-side-cookie";
-    const clientSideCookieName = "client-side-cookie";
-
-    function sortStringArray(a, b) {
-        a = a.toLowerCase();
-        b = b.toLowerCase();
-
-        return a > b ? 1 : b > a ? -1 : 0;
-    }
-
-    function addLinebreakToOutput() {
-        let element = document.createElement("br");
-        output.appendChild(element);
-    }
-
-    function addOutput(message) {
-        let element = document.createElement("div");
-        element.innerText = message;
-        output.appendChild(element);
-    }
-
-    function checkCookies(isAfterDeletion) {
-        let unsortedTestPassedMessages = [];
-        let cookies = internals.getCookies();
-        if (!cookies.length)
-            addOutput((isAfterDeletion ? "After" : "Before") + " script-accessible deletion: No cookies found.");
-        for (let cookie of cookies) {
-            switch (cookie.name) {
-                case httpOnlyCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: " + (isAfterDeletion ? " " : "") + "HttpOnly cookie exists.");
-                    break;
-                case serverSideCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: Regular server-side cookie exists.");
-                    break;
-                case clientSideCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: Client-side cookie exists.");
-                    break;
-            }
-        }
-        let sortedTestPassedMessages = unsortedTestPassedMessages.sort(sortStringArray);
-        for (let testPassedMessage of sortedTestPassedMessages) {
-            addOutput(testPassedMessage);
-        }
-    }
-
-    const dbName = "TestDatabase";
-
-    function createIDBDataStore(callback) {
-        let request = indexedDB.open(dbName);
-        request.onerror = function() {
-            addOutput("Couldn't create indexedDB.");
-            finishTest();
-        };
-        request.onupgradeneeded = function(event) {
-            let db = event.target.result;
-            let objStore = db.createObjectStore("test", {autoIncrement: true});
-            objStore.add("value");
-            callback();
-        }
-    }
-
-    const maxIntervals = 20;
-
-    let intervalCounterIDB;
-    let checkIDBCallback;
-    let checkIDBIntervalID;
-    let semaphoreIDBCheck = false;
-    function checkIDBDataStoreExists(isAfterDeletion, callback) {
-        let request;
-        intervalCounterIDB = 0;
-        checkIDBCallback = callback;
-        if (!isAfterDeletion) {
-            // Check until there is a IDB.
-            checkIDBIntervalID = setInterval(function() {
-                if (semaphoreIDBCheck)
-                    return;
-                semaphoreIDBCheck = true;
-
-                if (++intervalCounterIDB >= maxIntervals) {
-                    clearInterval(checkIDBIntervalID);
-                    addOutput("Before deletion: IDB entry does not exist.");
-                    semaphoreIDBCheck = false;
-                    checkIDBCallback();
-                } else {
-                    request = indexedDB.open(dbName);
-                    request.onerror = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Couldn't open indexedDB.");
-                        semaphoreIDBCheck = false;
-                        finishTest();
-                    };
-                    request.onupgradeneeded = function () {
-                        // Let the next interval check again.
-                        semaphoreIDBCheck = false;
-                    };
-                    request.onsuccess = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Before deletion: IDB entry does exist.");
-                        semaphoreIDBCheck = false;
-                        checkIDBCallback();
-                    };
-                }
-            }, 200);
-        } else {
-            // Check until there is a IDB.
-            checkIDBIntervalID = setInterval(function () {
-                if (semaphoreIDBCheck)
-                    return;
-                semaphoreIDBCheck = true;
-
-                if (++intervalCounterIDB >= maxIntervals) {
-                    clearInterval(checkIDBIntervalID);
-                    addOutput("After deletion: IDB entry checks exhausted.");
-                    semaphoreIDBCheck = false;
-                    checkIDBCallback();
-                } else {
-                    request = indexedDB.open(dbName);
-                    request.onerror = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Couldn't open indexedDB.");
-                        semaphoreIDBCheck = false;
-                        finishTest();
-                    };
-                    request.onupgradeneeded = function () {
-                        // Let the next interval check again.
-                        semaphoreIDBCheck = false;
-                    };
-                    request.onsuccess = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("After deletion: IDB entry does exist.");
-                        semaphoreIDBCheck = false;
-                        checkIDBCallback();
-                    };
-                }
-            }, 200);
-        }
-    }
-
-    let intervalCounterLocalStorage;
-    let checkLocalStorageCallback;
-    let checkLocalStorageIntervalID;
-    const localStorageName = "test";
-    const localStorageValue = "value";
-    function checkLocalStorageExists(isAfterDeletion, callback) {
-        intervalCounterLocalStorage = 0;
-        checkLocalStorageCallback = callback;
-        if (!isAfterDeletion) {
-            // Check until there is LocalStorage.
-            checkLocalStorageIntervalID = setInterval(function() {
-                if (++intervalCounterLocalStorage >= maxIntervals) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("Before deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                } else if (testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("Before deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                }
-            }, 100);
-        } else {
-            // Check until there is no LocalStorage.
-            checkLocalStorageIntervalID = setInterval(function() {
-                if (++intervalCounterLocalStorage >= maxIntervals) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("After deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                } else if (!testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("After deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                }
-            }, 100);
-        }
-    }
-
-    async function writeWebsiteDataAndContinue() {
-        // Write cookies.
-        await fetch("/cookies/resources/set-http-only-cookie.php?cookieName=" + httpOnlyCookieName, { credentials: "same-origin" });
-        await fetch("/cookies/resources/setCookies.cgi", { headers: { "Set-Cookie": serverSideCookieName + "=1; path=/;" }, credentials: "same-origin" });
-        document.cookie = clientSideCookieName + "=1";
-
-        checkCookies(false);
-
-        // Write LocalStorage
-        localStorage.setItem(localStorageName, localStorageValue);
-        checkLocalStorageExists(false, function() {
-
-            // Write IndexedDB.
-            createIDBDataStore(function () {
-                checkIDBDataStoreExists(false, function() {
-                    addLinebreakToOutput();
-                    processWebsiteDataAndContinue();
-                });
-            });
-        });
-    }
-
-    function processWebsiteDataAndContinue() {
-        testRunner.installStatisticsDidScanDataRecordsCallback(checkWebsiteDataAndContinue);
-        testRunner.statisticsProcessStatisticsAndDataRecords();
-    }
-
-    function checkWebsiteDataAndContinue() {
-        checkCookies(true);
-        checkLocalStorageExists(true, function () {
-            checkIDBDataStoreExists(true, finishTest);
-        });
-    }
-
-    function finishTest() {
-        resetCookies();
-        testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(false, function() {
-            setEnableFeature(false, function() {
-                testRunner.notifyDone();
-            });
-        });
-    }
-
-    const originUnderTest  = "http://127.0.0.1:8000";
-    function runTest() {
-        setEnableFeature(true, function () {
-            testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(true, function() {
-                testRunner.setStatisticsPrevalentResource(originUnderTest, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(originUnderTest))
-                        addOutput("FAIL: " + originUnderTest + " didn't get classified as prevalent.");
-                    writeWebsiteDataAndContinue();
-                });
-            });
-        });
-    }
-</script>
-</body>
-</html>
diff --git a/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-expected.txt b/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-expected.txt
deleted file mode 100644 (file)
index 5b6a435..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Check that non-cookie website data does not get removed after a period of no user interaction if the website is a standalone web application.
-
-Before deletion: Client-side cookie exists.
-Before deletion: HttpOnly cookie exists.
-Before deletion: Regular server-side cookie exists.
-Before deletion: LocalStorage entry does exist.
-Before deletion: IDB entry does exist.
-
-After deletion: HttpOnly cookie exists.
-After deletion: Client-side cookie exists.
-After deletion: Regular server-side cookie exists.
-After deletion: LocalStorage entry does exist.
-After deletion: IDB entry does exist.
-
-
diff --git a/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html b/LayoutTests/http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html
deleted file mode 100644 (file)
index db844c0..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-<!-- webkit-test-runner [ standaloneWebApplicationURL=http://127.0.0.1 ] -->
-<!DOCTYPE html>
-<html>
-<head>
-    <script src="/cookies/resources/cookie-utilities.js"></script>
-    <script src="resources/util.js"></script>
-</head>
-<body onload="setTimeout('runTest()', 0)">
-<div id="description">Check that non-cookie website data does not get removed after a period of no user interaction if the website is a standalone web application.</div>
-<br>
-<div id="output"></div>
-<br>
-<script>
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
-
-    const httpOnlyCookieName = "http-only-cookie";
-    const serverSideCookieName = "server-side-cookie";
-    const clientSideCookieName = "client-side-cookie";
-
-    function sortStringArray(a, b) {
-        a = a.toLowerCase();
-        b = b.toLowerCase();
-
-        return a > b ? 1 : b > a ? -1 : 0;
-    }
-
-    function addLinebreakToOutput() {
-        let element = document.createElement("br");
-        output.appendChild(element);
-    }
-
-    function addOutput(message) {
-        let element = document.createElement("div");
-        element.innerText = message;
-        output.appendChild(element);
-    }
-
-    function checkCookies(isAfterDeletion) {
-        let unsortedTestPassedMessages = [];
-        let cookies = internals.getCookies();
-        if (!cookies.length)
-            addOutput((isAfterDeletion ? "After" : "Before") + " script-accessible deletion: No cookies found.");
-        for (let cookie of cookies) {
-            switch (cookie.name) {
-                case httpOnlyCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: " + (isAfterDeletion ? " " : "") + "HttpOnly cookie exists.");
-                    break;
-                case serverSideCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: Regular server-side cookie exists.");
-                    break;
-                case clientSideCookieName:
-                    unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " deletion: Client-side cookie exists.");
-                    break;
-            }
-        }
-        let sortedTestPassedMessages = unsortedTestPassedMessages.sort(sortStringArray);
-        for (let testPassedMessage of sortedTestPassedMessages) {
-            addOutput(testPassedMessage);
-        }
-    }
-
-    const dbName = "TestDatabase";
-
-    function createIDBDataStore(callback) {
-        let request = indexedDB.open(dbName);
-        request.onerror = function() {
-            addOutput("Couldn't create indexedDB.");
-            finishTest();
-        };
-        request.onupgradeneeded = function(event) {
-            let db = event.target.result;
-            let objStore = db.createObjectStore("test", {autoIncrement: true});
-            objStore.add("value");
-            callback();
-        }
-    }
-
-    const maxIntervals = 20;
-
-    let intervalCounterIDB;
-    let checkIDBCallback;
-    let checkIDBIntervalID;
-    let semaphoreIDBCheck = false;
-    function checkIDBDataStoreExists(isAfterDeletion, callback) {
-        let request;
-        intervalCounterIDB = 0;
-        checkIDBCallback = callback;
-        if (!isAfterDeletion) {
-            // Check until there is a IDB.
-            checkIDBIntervalID = setInterval(function() {
-                if (semaphoreIDBCheck)
-                    return;
-                semaphoreIDBCheck = true;
-
-                if (++intervalCounterIDB >= maxIntervals) {
-                    clearInterval(checkIDBIntervalID);
-                    addOutput("Before deletion: IDB entry does not exist.");
-                    semaphoreIDBCheck = false;
-                    checkIDBCallback();
-                } else {
-                    request = indexedDB.open(dbName);
-                    request.onerror = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Couldn't open indexedDB.");
-                        semaphoreIDBCheck = false;
-                        finishTest();
-                    };
-                    request.onupgradeneeded = function () {
-                        // Let the next interval check again.
-                        semaphoreIDBCheck = false;
-                    };
-                    request.onsuccess = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Before deletion: IDB entry does exist.");
-                        semaphoreIDBCheck = false;
-                        checkIDBCallback();
-                    };
-                }
-            }, 200);
-        } else {
-            // Check until there is a IDB.
-            checkIDBIntervalID = setInterval(function () {
-                if (semaphoreIDBCheck)
-                    return;
-                semaphoreIDBCheck = true;
-
-                if (++intervalCounterIDB >= maxIntervals) {
-                    clearInterval(checkIDBIntervalID);
-                    addOutput("After deletion: IDB entry checks exhausted.");
-                    semaphoreIDBCheck = false;
-                    checkIDBCallback();
-                } else {
-                    request = indexedDB.open(dbName);
-                    request.onerror = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("Couldn't open indexedDB.");
-                        semaphoreIDBCheck = false;
-                        finishTest();
-                    };
-                    request.onupgradeneeded = function () {
-                        // Let the next interval check again.
-                        semaphoreIDBCheck = false;
-                    };
-                    request.onsuccess = function () {
-                        clearInterval(checkIDBIntervalID);
-                        addOutput("After deletion: IDB entry does exist.");
-                        semaphoreIDBCheck = false;
-                        checkIDBCallback();
-                    };
-                }
-            }, 200);
-        }
-    }
-
-    let intervalCounterLocalStorage;
-    let checkLocalStorageCallback;
-    let checkLocalStorageIntervalID;
-    const localStorageName = "test";
-    const localStorageValue = "value";
-    function checkLocalStorageExists(isAfterDeletion, callback) {
-        intervalCounterLocalStorage = 0;
-        checkLocalStorageCallback = callback;
-        if (!isAfterDeletion) {
-            // Check until there is LocalStorage.
-            checkLocalStorageIntervalID = setInterval(function() {
-                if (++intervalCounterLocalStorage >= maxIntervals) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("Before deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                } else if (testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("Before deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                }
-            }, 100);
-        } else {
-            // Check until there is no LocalStorage.
-            checkLocalStorageIntervalID = setInterval(function() {
-                if (++intervalCounterLocalStorage >= maxIntervals) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("After deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                } else if (!testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
-                    clearInterval(checkLocalStorageIntervalID);
-                    let value = localStorage.getItem(localStorageName);
-                    addOutput("After deletion: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
-                    checkLocalStorageCallback();
-                }
-            }, 100);
-        }
-    }
-
-    async function writeWebsiteDataAndContinue() {
-        // Write cookies.
-        await fetch("/cookies/resources/set-http-only-cookie.php?cookieName=" + httpOnlyCookieName, { credentials: "same-origin" });
-        await fetch("/cookies/resources/setCookies.cgi", { headers: { "Set-Cookie": serverSideCookieName + "=1; path=/;" }, credentials: "same-origin" });
-        document.cookie = clientSideCookieName + "=1";
-
-        checkCookies(false);
-
-        // Write LocalStorage
-        localStorage.setItem(localStorageName, localStorageValue);
-        checkLocalStorageExists(false, function() {
-
-            // Write IndexedDB.
-            createIDBDataStore(function () {
-                checkIDBDataStoreExists(false, function() {
-                    addLinebreakToOutput();
-                    processWebsiteDataAndContinue();
-                });
-            });
-        });
-    }
-
-    function processWebsiteDataAndContinue() {
-        testRunner.installStatisticsDidScanDataRecordsCallback(checkWebsiteDataAndContinue);
-        testRunner.statisticsProcessStatisticsAndDataRecords();
-    }
-
-    function checkWebsiteDataAndContinue() {
-        checkCookies(true);
-        checkLocalStorageExists(true, function () {
-            checkIDBDataStoreExists(true, finishTest);
-        });
-    }
-
-    function finishTest() {
-        resetCookies();
-        testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(false, function() {
-            setEnableFeature(false, function() {
-                testRunner.notifyDone();
-            });
-        });
-    }
-
-    const originUnderTest  = "http://127.0.0.1:8000";
-    function runTest() {
-        setEnableFeature(true, function () {
-            testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(true, function() {
-                testRunner.setStatisticsPrevalentResource(originUnderTest, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(originUnderTest))
-                        addOutput("FAIL: " + originUnderTest + " didn't get classified as prevalent.");
-                    writeWebsiteDataAndContinue();
-                });
-            });
-        });
-    }
-</script>
-</body>
-</html>
index 922127e..febf517 100644 (file)
@@ -1,3 +1,17 @@
+2020-04-03  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, reverting r259440.
+
+        Introduced 2 failing tests on Mac and iOS
+
+        Reverted changeset:
+
+        "Add SPI to configure WebsiteDataStores with a URL for
+        standalone web applications and use it to disable first-party
+        website data removal in ITP"
+        https://bugs.webkit.org/show_bug.cgi?id=209634
+        https://trac.webkit.org/changeset/259440
+
 2020-04-03  Tim Horton  <timothy_horton@apple.com>
 
         Add a visual debug indicator for locating and identifying all kinds of WebViews
index 618c924..72db99b 100644 (file)
@@ -2454,8 +2454,6 @@ RegistrableDomainsToDeleteOrRestrictWebsiteDataFor ResourceLoadStatisticsDatabas
     Vector<DomainData> domains = this->domains();
     Vector<unsigned> domainIDsToClearGrandfathering;
     for (auto& statistic : domains) {
-        if (statistic.registrableDomain == standaloneApplicationDomain())
-            continue;
         oldestUserInteraction = std::min(oldestUserInteraction, statistic.mostRecentUserInteractionTime);
         if (shouldRemoveAllWebsiteDataFor(statistic, shouldCheckForGrandfathering)) {
             toDeleteOrRestrictFor.domainsToDeleteAllCookiesFor.append(statistic.registrableDomain);
index a438c02..05280f1 100644 (file)
@@ -974,8 +974,6 @@ RegistrableDomainsToDeleteOrRestrictWebsiteDataFor ResourceLoadStatisticsMemoryS
     auto oldestUserInteraction = now;
     RegistrableDomainsToDeleteOrRestrictWebsiteDataFor toDeleteOrRestrictFor;
     for (auto& statistic : m_resourceStatisticsMap.values()) {
-        if (statistic.registrableDomain == standaloneApplicationDomain())
-            continue;
         oldestUserInteraction = std::min(oldestUserInteraction, statistic.mostRecentUserInteractionTime);
         if (shouldRemoveAllWebsiteDataFor(statistic, shouldCheckForGrandfathering)) {
             toDeleteOrRestrictFor.domainsToDeleteAllCookiesFor.append(statistic.registrableDomain);
index a238af6..47814f3 100644 (file)
@@ -168,7 +168,6 @@ public:
     void setSameSiteStrictEnforcementEnabled(WebCore::SameSiteStrictEnforcementEnabled enabled) { m_sameSiteStrictEnforcementEnabled = enabled; };
     bool isSameSiteStrictEnforcementEnabled() const { return m_sameSiteStrictEnforcementEnabled == WebCore::SameSiteStrictEnforcementEnabled::Yes; };
     void setFirstPartyWebsiteDataRemovalMode(WebCore::FirstPartyWebsiteDataRemovalMode mode) { m_firstPartyWebsiteDataRemovalMode = mode; }
-    void setStandaloneApplicationDomain(RegistrableDomain&& domain) { m_standaloneApplicationDomain = WTFMove(domain); }
 
     virtual bool areAllThirdPartyCookiesBlockedUnder(const TopFrameDomain&) = 0;
     virtual void hasStorageAccess(const SubFrameDomain&, const TopFrameDomain&, Optional<WebCore::FrameIdentifier>, WebCore::PageIdentifier, CompletionHandler<void(bool)>&&) = 0;
@@ -246,7 +245,6 @@ protected:
     bool debugLoggingEnabled() const { return m_debugLoggingEnabled; };
     bool debugModeEnabled() const { return m_debugModeEnabled; }
     WebCore::FirstPartyWebsiteDataRemovalMode firstPartyWebsiteDataRemovalMode() const { return m_firstPartyWebsiteDataRemovalMode; }
-    RegistrableDomain standaloneApplicationDomain() const { return m_standaloneApplicationDomain; }
 
     static constexpr unsigned maxNumberOfRecursiveCallsInRedirectTraceBack { 50 };
     
@@ -287,7 +285,6 @@ private:
     bool m_dataRecordsBeingRemoved { false };
     ShouldIncludeLocalhost m_shouldIncludeLocalhost { ShouldIncludeLocalhost::Yes };
     WebCore::FirstPartyWebsiteDataRemovalMode m_firstPartyWebsiteDataRemovalMode { WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies };
-    RegistrableDomain m_standaloneApplicationDomain;
 };
 
 } // namespace WebKit
index 6d9cd9f..08ede6c 100644 (file)
@@ -635,24 +635,6 @@ void WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode(FirstPa
     });
 }
 
-void WebResourceLoadStatisticsStore::setStandaloneApplicationDomain(const RegistrableDomain& domain, CompletionHandler<void()>&& completionHandler)
-{
-    ASSERT(RunLoop::isMain());
-
-    if (isEphemeral()) {
-        completionHandler();
-        return;
-    }
-
-    postTask([this, domain = domain.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
-        if (m_statisticsStore)
-            m_statisticsStore->setStandaloneApplicationDomain(WTFMove(domain));
-        postTaskReply([completionHandler = WTFMove(completionHandler)]() mutable {
-            completionHandler();
-        });
-    });
-}
-
 void WebResourceLoadStatisticsStore::didCreateNetworkProcess()
 {
     ASSERT(RunLoop::isMain());
index 3030a4d..35b8303 100644 (file)
@@ -277,7 +277,6 @@ struct ThirdPartyData {
     void setThirdPartyCookieBlockingMode(WebCore::ThirdPartyCookieBlockingMode);
     void setSameSiteStrictEnforcementEnabled(WebCore::SameSiteStrictEnforcementEnabled);
     void setFirstPartyWebsiteDataRemovalMode(WebCore::FirstPartyWebsiteDataRemovalMode, CompletionHandler<void()>&&);
-    void setStandaloneApplicationDomain(const RegistrableDomain&, CompletionHandler<void()>&&);
     void didCreateNetworkProcess();
 
     void notifyResourceLoadStatisticsProcessed();
index 7524e48..330427b 100644 (file)
@@ -89,7 +89,6 @@ NetworkSession::NetworkSession(NetworkProcess& networkProcess, const NetworkSess
     , m_thirdPartyCookieBlockingMode(parameters.resourceLoadStatisticsParameters.thirdPartyCookieBlockingMode)
     , m_sameSiteStrictEnforcementEnabled(parameters.resourceLoadStatisticsParameters.sameSiteStrictEnforcementEnabled)
     , m_firstPartyWebsiteDataRemovalMode(parameters.resourceLoadStatisticsParameters.firstPartyWebsiteDataRemovalMode)
-    , m_standaloneApplicationDomain(parameters.resourceLoadStatisticsParameters.standaloneApplicationDomain)
 #endif
     , m_adClickAttribution(makeUniqueRef<AdClickAttributionManager>(networkProcess, parameters.sessionID))
     , m_testSpeedMultiplier(parameters.testSpeedMultiplier)
@@ -205,7 +204,6 @@ void NetworkSession::forwardResourceLoadStatisticsSettings()
     m_resourceLoadStatistics->setThirdPartyCookieBlockingMode(m_thirdPartyCookieBlockingMode);
     m_resourceLoadStatistics->setSameSiteStrictEnforcementEnabled(m_sameSiteStrictEnforcementEnabled);
     m_resourceLoadStatistics->setFirstPartyWebsiteDataRemovalMode(m_firstPartyWebsiteDataRemovalMode, [] { });
-    m_resourceLoadStatistics->setStandaloneApplicationDomain(m_standaloneApplicationDomain, [] { });
 }
 
 bool NetworkSession::isResourceLoadStatisticsEnabled() const
index 099ce74..4634293 100644 (file)
@@ -164,7 +164,6 @@ protected:
     WebCore::ThirdPartyCookieBlockingMode m_thirdPartyCookieBlockingMode { WebCore::ThirdPartyCookieBlockingMode::All };
     WebCore::SameSiteStrictEnforcementEnabled m_sameSiteStrictEnforcementEnabled { WebCore::SameSiteStrictEnforcementEnabled::No };
     WebCore::FirstPartyWebsiteDataRemovalMode m_firstPartyWebsiteDataRemovalMode { WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies };
-    WebCore::RegistrableDomain m_standaloneApplicationDomain;
 #endif
     bool m_isStaleWhileRevalidateEnabled { false };
     UniqueRef<AdClickAttributionManager> m_adClickAttribution;
index 927aec3..f497609 100644 (file)
@@ -47,7 +47,6 @@ struct ResourceLoadStatisticsParameters {
     WebCore::SameSiteStrictEnforcementEnabled sameSiteStrictEnforcementEnabled { WebCore::SameSiteStrictEnforcementEnabled::No };
 #endif
     WebCore::FirstPartyWebsiteDataRemovalMode firstPartyWebsiteDataRemovalMode { WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies };
-    WebCore::RegistrableDomain standaloneApplicationDomain { };
     WebCore::RegistrableDomain manualPrevalentResource { };
     
     void encode(IPC::Encoder& encoder) const
@@ -64,7 +63,6 @@ struct ResourceLoadStatisticsParameters {
         encoder << sameSiteStrictEnforcementEnabled;
 #endif
         encoder << firstPartyWebsiteDataRemovalMode;
-        encoder << standaloneApplicationDomain;
         encoder << manualPrevalentResource;
     }
 
@@ -122,11 +120,6 @@ struct ResourceLoadStatisticsParameters {
         if (!firstPartyWebsiteDataRemovalMode)
             return WTF::nullopt;
 
-        Optional<WebCore::RegistrableDomain> standaloneApplicationDomain;
-        decoder >> standaloneApplicationDomain;
-        if (!standaloneApplicationDomain)
-            return WTF::nullopt;
-
         Optional<WebCore::RegistrableDomain> manualPrevalentResource;
         decoder >> manualPrevalentResource;
         if (!manualPrevalentResource)
@@ -145,7 +138,6 @@ struct ResourceLoadStatisticsParameters {
             WTFMove(*sameSiteStrictEnforcementEnabled),
 #endif
             WTFMove(*firstPartyWebsiteDataRemovalMode),
-            WTFMove(*standaloneApplicationDomain),
             WTFMove(*manualPrevalentResource),
         }};
     }
index bae7bee..eeb481c 100644 (file)
@@ -74,8 +74,6 @@ WK_CLASS_AVAILABLE(macos(10.13), ios(11.0))
 
 @property (nonatomic, nullable, copy) NSURL *alternativeServicesStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
-@property (nonatomic, nullable, copy) NSURL *standaloneApplicationURL WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
-
 // Testing only.
 @property (nonatomic) BOOL allLoadsBlockedByDeviceManagementRestrictionsForTesting WK_API_AVAILABLE(macos(10.15), ios(13.0));
 
index ebc0ee1..b75a026 100644 (file)
@@ -423,16 +423,6 @@ static void checkURLArgument(NSURL *url)
     _configuration->setProxyConfiguration((__bridge CFDictionaryRef)[configuration copy]);
 }
 
-- (NSURL *)standaloneApplicationURL
-{
-    return _configuration->standaloneApplicationURL();
-}
-
-- (void)setStandaloneApplicationURL:(NSURL *)url
-{
-    _configuration->setStandaloneApplicationURL(url);
-}
-
 - (BOOL)allLoadsBlockedByDeviceManagementRestrictionsForTesting
 {
     return _configuration->allLoadsBlockedByDeviceManagementRestrictionsForTesting();
index b8fe9b7..295a49e 100644 (file)
@@ -599,7 +599,6 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
     WebCore::ThirdPartyCookieBlockingMode thirdPartyCookieBlockingMode = WebCore::ThirdPartyCookieBlockingMode::All;
 #endif
-    WebCore::RegistrableDomain standaloneApplicationDomain { };
     WebCore::FirstPartyWebsiteDataRemovalMode firstPartyWebsiteDataRemovalMode = WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies;
     WebCore::SameSiteStrictEnforcementEnabled sameSiteStrictEnforcementEnabled = WebCore::SameSiteStrictEnforcementEnabled::No;
     WebCore::RegistrableDomain manualPrevalentResource { };
@@ -618,7 +617,6 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with
             sameSiteStrictEnforcementEnabled = networkSessionParameters.resourceLoadStatisticsParameters.sameSiteStrictEnforcementEnabled;
 #endif
             firstPartyWebsiteDataRemovalMode = networkSessionParameters.resourceLoadStatisticsParameters.firstPartyWebsiteDataRemovalMode;
-            standaloneApplicationDomain = networkSessionParameters.resourceLoadStatisticsParameters.standaloneApplicationDomain;
             manualPrevalentResource = networkSessionParameters.resourceLoadStatisticsParameters.manualPrevalentResource;
         }
 
@@ -644,7 +642,6 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with
             sameSiteStrictEnforcementEnabled = networkSessionParameters.resourceLoadStatisticsParameters.sameSiteStrictEnforcementEnabled;
 #endif
             firstPartyWebsiteDataRemovalMode = networkSessionParameters.resourceLoadStatisticsParameters.firstPartyWebsiteDataRemovalMode;
-            standaloneApplicationDomain = networkSessionParameters.resourceLoadStatisticsParameters.standaloneApplicationDomain;
             manualPrevalentResource = networkSessionParameters.resourceLoadStatisticsParameters.manualPrevalentResource;
         }
 
index ecdf8df..a70b7d5 100644 (file)
@@ -180,7 +180,6 @@ void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters&
     parameters.networkSessionParameters.resourceLoadStatisticsParameters.enableDebugMode = enableResourceLoadStatisticsDebugMode;
     parameters.networkSessionParameters.resourceLoadStatisticsParameters.sameSiteStrictEnforcementEnabled = sameSiteStrictEnforcementEnabled;
     parameters.networkSessionParameters.resourceLoadStatisticsParameters.firstPartyWebsiteDataRemovalMode = firstPartyWebsiteDataRemovalMode;
-    parameters.networkSessionParameters.resourceLoadStatisticsParameters.standaloneApplicationDomain = WebCore::RegistrableDomain { m_configuration->standaloneApplicationURL() };
     parameters.networkSessionParameters.resourceLoadStatisticsParameters.manualPrevalentResource = WTFMove(resourceLoadStatisticsManualPrevalentResource);
 
     auto cookieFile = resolvedCookieStorageFile();
index 0fb3a10..71e7627 100644 (file)
@@ -91,7 +91,6 @@ Ref<WebsiteDataStoreConfiguration> WebsiteDataStoreConfiguration::copy() const
     copy->m_testSpeedMultiplier = this->m_testSpeedMultiplier;
     copy->m_suppressesConnectionTerminationOnSystemChange = this->m_suppressesConnectionTerminationOnSystemChange;
     copy->m_allowsServerPreconnect = this->m_allowsServerPreconnect;
-    copy->m_standaloneApplicationURL = this->m_standaloneApplicationURL;
 #if PLATFORM(COCOA)
     if (m_proxyConfiguration)
         copy->m_proxyConfiguration = adoptCF(CFDictionaryCreateCopy(nullptr, this->m_proxyConfiguration.get()));
index 15fbe7e..3e345b3 100644 (file)
@@ -153,10 +153,6 @@ public:
     bool allowsServerPreconnect() const { return m_allowsServerPreconnect; }
     void setAllowsServerPreconnect(bool allows) { m_allowsServerPreconnect = allows; }
 
-    
-    const URL& standaloneApplicationURL() const { return m_standaloneApplicationURL; }
-    void setStandaloneApplicationURL(URL&& url) { m_standaloneApplicationURL = WTFMove(url); }
-
 private:
     IsPersistent m_isPersistent { IsPersistent::No };
 
@@ -199,7 +195,6 @@ private:
     bool m_suppressesConnectionTerminationOnSystemChange { false };
     bool m_allowsServerPreconnect { true };
     unsigned m_testSpeedMultiplier { 1 };
-    URL m_standaloneApplicationURL;
 #if PLATFORM(COCOA)
     RetainPtr<CFDictionaryRef> m_proxyConfiguration;
 #endif
index d37a941..de6b19a 100644 (file)
@@ -1,3 +1,17 @@
+2020-04-03  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, reverting r259440.
+
+        Introduced 2 failing tests on Mac and iOS
+
+        Reverted changeset:
+
+        "Add SPI to configure WebsiteDataStores with a URL for
+        standalone web applications and use it to disable first-party
+        website data removal in ITP"
+        https://bugs.webkit.org/show_bug.cgi?id=209634
+        https://trac.webkit.org/changeset/259440
+
 2020-04-03  Kate Cheney  <katherine_cheney@apple.com>
 
         Remove _setIsNavigatingToAppBoundDomain testing SPI
index ed7002a..77a6443 100644 (file)
@@ -1359,11 +1359,6 @@ static std::string parseStringTestHeaderValueAsRelativePath(const std::string& v
     return toSTD(adoptWK(WKURLCopyPath(relativeURL.get())));
 }
 
-static std::string parseStringTestHeaderValueAsURL(const std::string& value)
-{
-    return toSTD(adoptWK(WKURLCopyString(createTestURL(value.c_str()))));
-}
-
 static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std::string& pathOrURL, const std::string& absolutePath)
 {
     std::string filename = absolutePath;
@@ -1517,9 +1512,7 @@ static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std:
             testOptions.enableCaptureAudioInGPUProcess = parseBooleanTestHeaderValue(value);
         else if (key == "allowTopNavigationToDataURLs")
             testOptions.allowTopNavigationToDataURLs = parseBooleanTestHeaderValue(value);
-        else if (key == "standaloneWebApplicationURL")
-            testOptions.standaloneWebApplicationURL = parseStringTestHeaderValueAsURL(value);
-
+        
         pairStart = pairEnd + 1;
     }
 }
index 7bd076c..b94f8f7 100644 (file)
@@ -110,7 +110,6 @@ struct TestOptions {
     std::string applicationManifest;
     std::string jscOptions;
     std::string additionalSupportedImageTypes;
-    std::string standaloneWebApplicationURL;
     HashMap<String, bool> experimentalFeatures;
     HashMap<String, bool> internalDebugFeatures;
     String contentMode;
@@ -169,8 +168,7 @@ struct TestOptions {
             || enableCaptureVideoInUIProcess != options.enableCaptureVideoInUIProcess
             || enableCaptureVideoInGPUProcess != options.enableCaptureVideoInGPUProcess
             || enableCaptureAudioInGPUProcess != options.enableCaptureAudioInGPUProcess
-            || allowTopNavigationToDataURLs != options.allowTopNavigationToDataURLs
-            || standaloneWebApplicationURL != options.standaloneWebApplicationURL)
+            || allowTopNavigationToDataURLs != options.allowTopNavigationToDataURLs)
             return false;
 
         if (!contextOptions.hasSameInitializationOptions(options.contextOptions))
index 033498c..548fe73 100644 (file)
@@ -51,7 +51,6 @@
 #import <WebKit/_WKApplicationManifest.h>
 #import <WebKit/_WKUserContentExtensionStore.h>
 #import <WebKit/_WKUserContentExtensionStorePrivate.h>
-#import <WebKit/_WKWebsiteDataStoreConfiguration.h>
 #import <wtf/MainThread.h>
 #import <wtf/spi/cocoa/SecuritySPI.h>
 
@@ -150,13 +149,10 @@ void TestController::platformCreateWebView(WKPageConfigurationRef, const TestOpt
     if (options.enableEditableImages)
         [copiedConfiguration _setEditableImagesEnabled:YES];
 
-    if (options.useEphemeralSession || options.standaloneWebApplicationURL.length()) {
-        auto websiteDataStoreConfig = options.useEphemeralSession ? [[[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration] autorelease] : [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease];
-        if (options.standaloneWebApplicationURL.length())
-            [websiteDataStoreConfig setStandaloneApplicationURL:[NSURL URLWithString:[NSString stringWithUTF8String:options.standaloneWebApplicationURL.c_str()]]];
-        auto websiteDataStore = [[[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfig] autorelease];
-        [websiteDataStore _setResourceLoadStatisticsEnabled:YES];
-        [copiedConfiguration setWebsiteDataStore:websiteDataStore];
+    if (options.useEphemeralSession) {
+        auto ephemeralWebsiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
+        [ephemeralWebsiteDataStore _setResourceLoadStatisticsEnabled:YES];
+        [copiedConfiguration setWebsiteDataStore:ephemeralWebsiteDataStore];
     }
 
     [copiedConfiguration _setAllowTopNavigationToDataURLs:options.allowTopNavigationToDataURLs];