Diff
Modified: branches/safari-611.1.21.2-branch/LayoutTests/ChangeLog (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/ChangeLog 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/ChangeLog 2021-03-01 20:53:49 UTC (rev 273682)
@@ -61,126 +61,6 @@
* webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
* webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
-2021-03-01 Alan Coon <[email protected]>
-
- Cherry-pick r273590. rdar://problem/74881403
-
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
-
- Reviewed by Brent Fulgham and informally by Kate Cheney.
-
- Source/WebKit:
-
- Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html
- http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html
-
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
- (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters):
- Now sets two new member variables:
- - Optional<OperatingDate> m_longWindowOperatingDate
- - Optional<OperatingDate> m_shortWindowOperatingDate
- These are only set if the minimum number of operating days has passed.
- This function no longer sets m_leastRecentOperatingDate.
- (WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
- Now checks against the two new member variables m_longWindowOperatingDate
- and m_shortWindowOperatingDate. This fixes the bug.
- (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
- Test infrastructure. Now takes the new parameter numberOfOperatingDaysPassed
- with which layout tests can control the exact number of operating days
- passed since user interaction.
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
- Added m_longWindowOperatingDate and m_shortWindowOperatingDate, and
- removed m_leastRecentOperatingDate since it's no longer used.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
- (WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
- Test infrastructure. The same changes as in the DB store.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
- * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
- (WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
- * NetworkProcess/NetworkProcess.cpp:
- (WebKit::NetworkProcess::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/NetworkProcess.h:
- * NetworkProcess/NetworkProcess.messages.in:
- * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
- (WKWebsiteDataStoreSetStatisticsExpiredStatistic):
- Test infrastructure.
- * UIProcess/API/C/WKWebsiteDataStoreRef.h:
- * UIProcess/Network/NetworkProcessProxy.cpp:
- (WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/Network/NetworkProcessProxy.h:
- * UIProcess/WebsiteData/WebsiteDataStore.cpp:
- (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/WebsiteData/WebsiteDataStore.h:
-
- Tools:
-
- A new numberOfOperatingDaysPassed parameter was added to
- testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
-
- * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
- * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
- (WTR::TestRunner::setStatisticsExpiredStatistic):
- * WebKitTestRunner/InjectedBundle/TestRunner.h:
- * WebKitTestRunner/TestController.cpp:
- (WTR::TestController::setStatisticsExpiredStatistic):
- * WebKitTestRunner/TestController.h:
- * WebKitTestRunner/TestInvocation.cpp:
- (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
-
- LayoutTests:
-
- Existing test cases now make use of the new numberOfOperatingDaysPassed
- parameter to testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
- A new test case makes sure website data is not deleted below the threshold.
-
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt: Added.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html: Added.
- Sets numberOfOperatingDaysPassed to 6.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html.
- Sets numberOfOperatingDaysPassed to 7.
- * http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html:
- Sets numberOfOperatingDaysPassed to 30.
- * platform/wk2/TestExpectations:
- Updated existing expectation with new file name.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2021-02-26 John Wilander <[email protected]>
-
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
-
- Reviewed by Brent Fulgham and informally by Kate Cheney.
-
- Existing test cases now make use of the new numberOfOperatingDaysPassed
- parameter to testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
- A new test case makes sure website data is not deleted below the threshold.
-
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt: Added.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html: Added.
- Sets numberOfOperatingDaysPassed to 6.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html.
- Sets numberOfOperatingDaysPassed to 7.
- * http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html:
- Sets numberOfOperatingDaysPassed to 30.
- * platform/wk2/TestExpectations:
- Updated existing expectation with new file name.
-
2021-02-26 Alan Coon <[email protected]>
Cherry-pick r273512. rdar://problem/74799698
Deleted: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,14 +0,0 @@
-
-Before statistics processing: Client-side cookie exists.
-Before statistics processing: HttpOnly cookie exists.
-Before statistics processing: Regular server-side cookie exists.
-Before statistics processing: LocalStorage entry does exist.
-Before statistics processing: IDB entry does exist.
-
-After statistics processing: HttpOnly cookie exists.
-After statistics processing: Client-side cookie exists.
-After statistics processing: Regular server-side cookie exists.
-After statistics processing: LocalStorage entry does exist.
-After statistics processing: IDB entry does exist.
-
-
Deleted: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,262 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <script src=""
- <script src=""
-</head>
-<body _onload_="setTimeout('runTest()', 0)">
-<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 && isAfterDeletion)
- addOutput("FAIL: " + "No cookies found.");
- for (let cookie of cookies) {
- switch (cookie.name) {
- case httpOnlyCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: " + (isAfterDeletion ? " " : "") + "HttpOnly cookie exists.");
- break;
- case serverSideCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: Regular server-side cookie exists.");
- break;
- case clientSideCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: 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 statistics processing: 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 statistics processing: IDB entry does exist.");
- semaphoreIDBCheck = false;
- checkIDBCallback();
- };
- }
- }, 200);
- } else {
- // Check until there is no IDB.
- checkIDBIntervalID = setInterval(function () {
- if (semaphoreIDBCheck)
- return;
- semaphoreIDBCheck = true;
-
- if (++intervalCounterIDB >= maxIntervals) {
- clearInterval(checkIDBIntervalID);
- addOutput("After statistics processing: IDB entry does 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 () {
- clearInterval(checkIDBIntervalID);
- addOutput("After statistics processing: IDB entry does not exist.");
- semaphoreIDBCheck = false;
- finishTest();
- };
- request._onsuccess_ = function () {
- // Let the next interval check again because deletion might be delayed.
- semaphoreIDBCheck = false;
- };
- }
- }, 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
- checkLocalStorageCallback();
- } else if (testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
- clearInterval(checkLocalStorageIntervalID);
- let value = localStorage.getItem(localStorageName);
- addOutput("Before statistics processing: 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
- checkLocalStorageCallback();
- } else if (!testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
- clearInterval(checkLocalStorageIntervalID);
- let value = localStorage.getItem(localStorageName);
- addOutput("After statistics processing: 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);
- });
- }
-
- const originUnderTest = "http://127.0.0.1:8000";
- const otherOrigin = "http://localhost:8000"
- const topFrameOrigin = "http://127.0.0.2:8000";
- const timeStamp = Math.round((new Date()).getTime() / 1000);
- function finishTest() {
- if (!testRunner.isStatisticsHasHadUserInteraction(originUnderTest))
- addOutput("FAIL: " + originUnderTest + " doesn't have user interaction after processing.");
- resetCookies();
- setEnableFeature(false, function() {
- testRunner.notifyDone();
- });
- }
-
- // Do not use setEnableFeature here because we want to make sure website data deletion is not skipped
- // by the presence of parameters().isRunningTest.
- function runTest() {
- testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(3600);
- // Merge a statistic with no user interaction to check the -1 case.
- testRunner.setStatisticsMergeStatistic(otherOrigin, topFrameOrigin, "", timeStamp, false, -1, false, false, false, 0, function() {
- testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(true, function () {
- testRunner.setStatisticsExpiredStatistic(originUnderTest,
- 6, // numberOfOperatingDaysPassed
- true, // hasUserInteraction
- false, // isScheduledForAllButCookieDataRemoval,
- false, // isPrevalent
- function() {
- writeWebsiteDataAndContinue();
- });
- });
- });
- }
-</script>
-</body>
-</html>
Copied: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt (from rev 273677, branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt) (0 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt (rev 0)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt 2021-03-01 20:53:49 UTC (rev 273682)
@@ -0,0 +1,14 @@
+
+Before statistics processing: Client-side cookie exists.
+Before statistics processing: HttpOnly cookie exists.
+Before statistics processing: Regular server-side cookie exists.
+Before statistics processing: LocalStorage entry does exist.
+Before statistics processing: IDB entry does exist.
+
+After statistics processing: HttpOnly cookie exists.
+After statistics processing: Client-side cookie exists.
+After statistics processing: Regular server-side cookie exists.
+After statistics processing: LocalStorage entry does not exist.
+After statistics processing: IDB entry does not exist.
+
+
Copied: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html (from rev 273677, branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html) (0 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html (rev 0)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html 2021-03-01 20:53:49 UTC (rev 273682)
@@ -0,0 +1,258 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+</head>
+<body _onload_="setTimeout('runTest()', 0)">
+<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 && isAfterDeletion)
+ addOutput("FAIL: " + "No cookies found.");
+ for (let cookie of cookies) {
+ switch (cookie.name) {
+ case httpOnlyCookieName:
+ unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: " + (isAfterDeletion ? " " : "") + "HttpOnly cookie exists.");
+ break;
+ case serverSideCookieName:
+ unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: Regular server-side cookie exists.");
+ break;
+ case clientSideCookieName:
+ unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: 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 statistics processing: 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 statistics processing: IDB entry does exist.");
+ semaphoreIDBCheck = false;
+ checkIDBCallback();
+ };
+ }
+ }, 200);
+ } else {
+ // Check until there is no IDB.
+ checkIDBIntervalID = setInterval(function () {
+ if (semaphoreIDBCheck)
+ return;
+ semaphoreIDBCheck = true;
+
+ if (++intervalCounterIDB >= maxIntervals) {
+ clearInterval(checkIDBIntervalID);
+ addOutput("After statistics processing: IDB entry does 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 () {
+ clearInterval(checkIDBIntervalID);
+ addOutput("After statistics processing: IDB entry does not exist.");
+ semaphoreIDBCheck = false;
+ finishTest();
+ };
+ request._onsuccess_ = function () {
+ // Let the next interval check again because deletion might be delayed.
+ semaphoreIDBCheck = false;
+ };
+ }
+ }, 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
+ checkLocalStorageCallback();
+ } else if (testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
+ clearInterval(checkLocalStorageIntervalID);
+ let value = localStorage.getItem(localStorageName);
+ addOutput("Before statistics processing: 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
+ checkLocalStorageCallback();
+ } else if (!testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
+ clearInterval(checkLocalStorageIntervalID);
+ let value = localStorage.getItem(localStorageName);
+ addOutput("After statistics processing: 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);
+ });
+ }
+
+ const originUnderTest = "http://127.0.0.1:8000";
+ const otherOrigin = "http://localhost:8000"
+ const topFrameOrigin = "http://127.0.0.2:8000";
+ const timeStamp = Math.round((new Date()).getTime() / 1000);
+ function finishTest() {
+ if (testRunner.isStatisticsHasHadUserInteraction(originUnderTest))
+ addOutput("FAIL: " + originUnderTest + " still has user interaction after processing.");
+ resetCookies();
+ setEnableFeature(false, function() {
+ testRunner.notifyDone();
+ });
+ }
+
+ // Do not use setEnableFeature here because we want to make sure website data deletion is not skipped
+ // by the presence of parameters().isRunningTest.
+ function runTest() {
+ testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(3600);
+ // Merge a statistic with no user interaction to check the -1 case.
+ testRunner.setStatisticsMergeStatistic(otherOrigin, topFrameOrigin, "", timeStamp, false, -1, false, false, false, 0, function() {
+ testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(true, function () {
+ // insertStatisticsExpiredStatistic(domain, hasHadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent)
+ testRunner.setStatisticsExpiredStatistic(originUnderTest, true, true, false, function() {
+ writeWebsiteDataAndContinue();
+ });
+ });
+ });
+ }
+</script>
+</body>
+</html>
Deleted: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,14 +0,0 @@
-
-Before statistics processing: Client-side cookie exists.
-Before statistics processing: HttpOnly cookie exists.
-Before statistics processing: Regular server-side cookie exists.
-Before statistics processing: LocalStorage entry does exist.
-Before statistics processing: IDB entry does exist.
-
-After statistics processing: HttpOnly cookie exists.
-After statistics processing: Client-side cookie exists.
-After statistics processing: Regular server-side cookie exists.
-After statistics processing: LocalStorage entry does exist.
-After statistics processing: IDB entry does exist.
-
-
Deleted: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,262 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <script src=""
- <script src=""
-</head>
-<body _onload_="setTimeout('runTest()', 0)">
-<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 && isAfterDeletion)
- addOutput("FAIL: " + "No cookies found.");
- for (let cookie of cookies) {
- switch (cookie.name) {
- case httpOnlyCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: " + (isAfterDeletion ? " " : "") + "HttpOnly cookie exists.");
- break;
- case serverSideCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: Regular server-side cookie exists.");
- break;
- case clientSideCookieName:
- unsortedTestPassedMessages.push((isAfterDeletion ? "After" : "Before") + " statistics processing: 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 statistics processing: 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 statistics processing: IDB entry does exist.");
- semaphoreIDBCheck = false;
- checkIDBCallback();
- };
- }
- }, 200);
- } else {
- // Check until there is no IDB.
- checkIDBIntervalID = setInterval(function () {
- if (semaphoreIDBCheck)
- return;
- semaphoreIDBCheck = true;
-
- if (++intervalCounterIDB >= maxIntervals) {
- clearInterval(checkIDBIntervalID);
- addOutput("After statistics processing: IDB entry does 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 () {
- clearInterval(checkIDBIntervalID);
- addOutput("After statistics processing: IDB entry does not exist.");
- semaphoreIDBCheck = false;
- finishTest();
- };
- request._onsuccess_ = function () {
- // Let the next interval check again because deletion might be delayed.
- semaphoreIDBCheck = false;
- };
- }
- }, 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
- checkLocalStorageCallback();
- } else if (testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
- clearInterval(checkLocalStorageIntervalID);
- let value = localStorage.getItem(localStorageName);
- addOutput("Before statistics processing: 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 statistics processing: LocalStorage entry " + (value === localStorageValue ? "does" : "does not") + " exist.");
- checkLocalStorageCallback();
- } else if (!testRunner.isStatisticsHasLocalStorage(originUnderTest)) {
- clearInterval(checkLocalStorageIntervalID);
- let value = localStorage.getItem(localStorageName);
- addOutput("After statistics processing: 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);
- });
- }
-
- const originUnderTest = "http://127.0.0.1:8000";
- const otherOrigin = "http://localhost:8000"
- const topFrameOrigin = "http://127.0.0.2:8000";
- const timeStamp = Math.round((new Date()).getTime() / 1000);
- function finishTest() {
- if (!testRunner.isStatisticsHasHadUserInteraction(originUnderTest))
- addOutput("FAIL: " + originUnderTest + " doesn't have user interaction after processing.");
- resetCookies();
- setEnableFeature(false, function() {
- testRunner.notifyDone();
- });
- }
-
- // Do not use setEnableFeature here because we want to make sure website data deletion is not skipped
- // by the presence of parameters().isRunningTest.
- function runTest() {
- testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(3600);
- // Merge a statistic with no user interaction to check the -1 case.
- testRunner.setStatisticsMergeStatistic(otherOrigin, topFrameOrigin, "", timeStamp, false, -1, false, false, false, 0, function() {
- testRunner.setStatisticsFirstPartyWebsiteDataRemovalMode(true, function () {
- testRunner.setStatisticsExpiredStatistic(originUnderTest,
- 7, // numberOfOperatingDaysPassed
- true, // hasUserInteraction
- false, // isScheduledForAllButCookieDataRemoval,
- false, // isPrevalent
- function() {
- writeWebsiteDataAndContinue();
- });
- });
- });
- }
-</script>
-</body>
-</html>
Modified: branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html 2021-03-01 20:53:49 UTC (rev 273682)
@@ -238,12 +238,8 @@
function runTest() {
setEnableFeature(true, function () {
- testRunner.setStatisticsExpiredStatistic(originUnderTest,
- 30, // numberOfOperatingDaysPassed
- true, // hasUserInteraction
- false, // isScheduledForAllButCookieDataRemoval,
- true, // isPrevalent
- function() {
+ // insertStatisticsExpiredStatistic(domain, hasHadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent)
+ testRunner.setStatisticsExpiredStatistic(originUnderTest, true, false, true, function() {
if (!testRunner.isStatisticsPrevalentResource(originUnderTest))
addOutput("FAIL: " + originUnderTest + " did not get inserted into database.");
writeWebsiteDataAndContinue();
Modified: branches/safari-611.1.21.2-branch/LayoutTests/platform/wk2/TestExpectations (273681 => 273682)
--- branches/safari-611.1.21.2-branch/LayoutTests/platform/wk2/TestExpectations 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/LayoutTests/platform/wk2/TestExpectations 2021-03-01 20:53:49 UTC (rev 273682)
@@ -711,7 +711,7 @@
http/tests/resourceLoadStatistics/enforce-samesite-strict-based-on-top-frame-unique-redirects-to.html [ Skip ]
# This test is flaky. <rdar://problem/69748720>
-http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html [ Pass Failure ]
+http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html [ Pass Failure ]
# The CNAME and cookie transform SPIs are only available in macOS Big Sur + iOS 14 and above.
http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html [ Skip ]
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/ChangeLog (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/ChangeLog 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/ChangeLog 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,154 +1,3 @@
-2021-03-01 Alan Coon <[email protected]>
-
- Cherry-pick r273590. rdar://problem/74881403
-
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
-
- Reviewed by Brent Fulgham and informally by Kate Cheney.
-
- Source/WebKit:
-
- Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html
- http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html
-
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
- (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters):
- Now sets two new member variables:
- - Optional<OperatingDate> m_longWindowOperatingDate
- - Optional<OperatingDate> m_shortWindowOperatingDate
- These are only set if the minimum number of operating days has passed.
- This function no longer sets m_leastRecentOperatingDate.
- (WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
- Now checks against the two new member variables m_longWindowOperatingDate
- and m_shortWindowOperatingDate. This fixes the bug.
- (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
- Test infrastructure. Now takes the new parameter numberOfOperatingDaysPassed
- with which layout tests can control the exact number of operating days
- passed since user interaction.
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
- Added m_longWindowOperatingDate and m_shortWindowOperatingDate, and
- removed m_leastRecentOperatingDate since it's no longer used.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
- (WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
- Test infrastructure. The same changes as in the DB store.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
- * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
- (WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
- * NetworkProcess/NetworkProcess.cpp:
- (WebKit::NetworkProcess::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/NetworkProcess.h:
- * NetworkProcess/NetworkProcess.messages.in:
- * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
- (WKWebsiteDataStoreSetStatisticsExpiredStatistic):
- Test infrastructure.
- * UIProcess/API/C/WKWebsiteDataStoreRef.h:
- * UIProcess/Network/NetworkProcessProxy.cpp:
- (WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/Network/NetworkProcessProxy.h:
- * UIProcess/WebsiteData/WebsiteDataStore.cpp:
- (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/WebsiteData/WebsiteDataStore.h:
-
- Tools:
-
- A new numberOfOperatingDaysPassed parameter was added to
- testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
-
- * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
- * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
- (WTR::TestRunner::setStatisticsExpiredStatistic):
- * WebKitTestRunner/InjectedBundle/TestRunner.h:
- * WebKitTestRunner/TestController.cpp:
- (WTR::TestController::setStatisticsExpiredStatistic):
- * WebKitTestRunner/TestController.h:
- * WebKitTestRunner/TestInvocation.cpp:
- (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
-
- LayoutTests:
-
- Existing test cases now make use of the new numberOfOperatingDaysPassed
- parameter to testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
- A new test case makes sure website data is not deleted below the threshold.
-
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt: Added.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html: Added.
- Sets numberOfOperatingDaysPassed to 6.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html.
- Sets numberOfOperatingDaysPassed to 7.
- * http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html:
- Sets numberOfOperatingDaysPassed to 30.
- * platform/wk2/TestExpectations:
- Updated existing expectation with new file name.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2021-02-26 John Wilander <[email protected]>
-
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
-
- Reviewed by Brent Fulgham and informally by Kate Cheney.
-
- Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html
- http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html
-
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
- (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters):
- Now sets two new member variables:
- - Optional<OperatingDate> m_longWindowOperatingDate
- - Optional<OperatingDate> m_shortWindowOperatingDate
- These are only set if the minimum number of operating days has passed.
- This function no longer sets m_leastRecentOperatingDate.
- (WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
- Now checks against the two new member variables m_longWindowOperatingDate
- and m_shortWindowOperatingDate. This fixes the bug.
- (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
- Test infrastructure. Now takes the new parameter numberOfOperatingDaysPassed
- with which layout tests can control the exact number of operating days
- passed since user interaction.
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
- Added m_longWindowOperatingDate and m_shortWindowOperatingDate, and
- removed m_leastRecentOperatingDate since it's no longer used.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
- (WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
- Test infrastructure. The same changes as in the DB store.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
- * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
- (WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
- * NetworkProcess/NetworkProcess.cpp:
- (WebKit::NetworkProcess::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/NetworkProcess.h:
- * NetworkProcess/NetworkProcess.messages.in:
- * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
- (WKWebsiteDataStoreSetStatisticsExpiredStatistic):
- Test infrastructure.
- * UIProcess/API/C/WKWebsiteDataStoreRef.h:
- * UIProcess/Network/NetworkProcessProxy.cpp:
- (WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/Network/NetworkProcessProxy.h:
- * UIProcess/WebsiteData/WebsiteDataStore.cpp:
- (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/WebsiteData/WebsiteDataStore.h:
-
2021-02-25 Russell Epstein <[email protected]>
Cherry-pick r273452. rdar://problem/74753294
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -2739,7 +2739,7 @@
{
SQLiteStatement countOperatingDatesStatement(m_database, "SELECT COUNT(*) FROM OperatingDates;"_s);
SQLiteStatement getMostRecentOperatingDateStatement(m_database, "SELECT * FROM OperatingDates ORDER BY year DESC, month DESC, monthDay DESC LIMIT 1;"_s);
- SQLiteStatement getOperatingDateWindowStatement(m_database, "SELECT * FROM OperatingDates ORDER BY year DESC, month DESC, monthDay DESC LIMIT 1 OFFSET ?;"_s);
+ SQLiteStatement getLeastRecentOperatingDateStatement(m_database, "SELECT * FROM OperatingDates ORDER BY year, month, monthDay LIMIT 1;"_s);
if (countOperatingDatesStatement.prepare() != SQLITE_OK
|| countOperatingDatesStatement.step() != SQLITE_ROW) {
@@ -2756,38 +2756,17 @@
ASSERT_NOT_REACHED();
return;
}
+
m_mostRecentOperatingDate = OperatingDate(getMostRecentOperatingDateStatement.getColumnInt(0), getMostRecentOperatingDateStatement.getColumnInt(1), getMostRecentOperatingDateStatement.getColumnInt(2));
- if (getOperatingDateWindowStatement.prepare() != SQLITE_OK) {
- RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters getOperatingDateWindowStatement failed during the call to prepare() with error message: %{private}s.", this, m_database.lastErrorMsg());
+ if (getLeastRecentOperatingDateStatement.prepare() != SQLITE_OK
+ || getLeastRecentOperatingDateStatement.step() != SQLITE_ROW) {
+ RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters getLeastRecentOperatingDateStatement failed to step, error message: %{private}s", this, m_database.lastErrorMsg());
ASSERT_NOT_REACHED();
return;
}
- if (m_operatingDatesSize <= operatingDatesWindowShort - 1)
- m_shortWindowOperatingDate = WTF::nullopt;
- else {
- if (getOperatingDateWindowStatement.bindInt(1, operatingDatesWindowShort - 1) != SQLITE_OK
- || getOperatingDateWindowStatement.step() != SQLITE_ROW) {
- RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters getOperatingDateWindowStatement failed with error message: %{private}s. The error could be in the calls to bind() or step().", this, m_database.lastErrorMsg());
- ASSERT_NOT_REACHED();
- return;
- }
- m_shortWindowOperatingDate = OperatingDate(getOperatingDateWindowStatement.getColumnInt(0), getOperatingDateWindowStatement.getColumnInt(1), getOperatingDateWindowStatement.getColumnInt(2));
- }
-
- if (m_operatingDatesSize <= operatingDatesWindowLong - 1)
- m_longWindowOperatingDate = WTF::nullopt;
- else {
- getOperatingDateWindowStatement.reset();
- if (getOperatingDateWindowStatement.bindInt(1, operatingDatesWindowLong - 1) != SQLITE_OK
- || getOperatingDateWindowStatement.step() != SQLITE_ROW) {
- RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters getOperatingDateWindowStatement failed with error message: %{private}s. The error could be in the calls to bind() or step().", this, m_database.lastErrorMsg());
- ASSERT_NOT_REACHED();
- return;
- }
- m_longWindowOperatingDate = OperatingDate(getOperatingDateWindowStatement.getColumnInt(0), getOperatingDateWindowStatement.getColumnInt(1), getOperatingDateWindowStatement.getColumnInt(2));
- }
+ m_leastRecentOperatingDate = OperatingDate(getLeastRecentOperatingDateStatement.getColumnInt(0), getLeastRecentOperatingDateStatement.getColumnInt(1), getLeastRecentOperatingDateStatement.getColumnInt(2));
}
void ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary()
@@ -2828,14 +2807,13 @@
{
ASSERT(!RunLoop::isMain());
+ unsigned operatingDatesWindowInDays = 0;
switch (operatingDatesWindow) {
case OperatingDatesWindow::Long:
- if (m_longWindowOperatingDate && OperatingDate::fromWallTime(mostRecentUserInteractionTime) < *m_longWindowOperatingDate)
- return true;
+ operatingDatesWindowInDays = operatingDatesWindowLong;
break;
case OperatingDatesWindow::Short:
- if (m_shortWindowOperatingDate && OperatingDate::fromWallTime(mostRecentUserInteractionTime) < *m_shortWindowOperatingDate)
- return true;
+ operatingDatesWindowInDays = operatingDatesWindowShort;
break;
case OperatingDatesWindow::ForLiveOnTesting:
return WallTime::now() > mostRecentUserInteractionTime + operatingTimeWindowForLiveOnTesting;
@@ -2843,6 +2821,11 @@
return true;
}
+ if (m_operatingDatesSize >= operatingDatesWindowInDays) {
+ if (OperatingDate::fromWallTime(mostRecentUserInteractionTime) < m_leastRecentOperatingDate)
+ return true;
+ }
+
// If we don't meet the real criteria for an expired statistic, check the user setting for a tighter restriction (mainly for testing).
if (this->parameters().timeToLiveUserInteraction) {
if (WallTime::now() > mostRecentUserInteractionTime + this->parameters().timeToLiveUserInteraction.value())
@@ -2851,11 +2834,11 @@
return false;
}
-void ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, unsigned numberOfOperatingDaysPassed, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
+void ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
{
// Populate the Operating Dates table with enough days to require pruning.
double daysAgoInSeconds = 0;
- for (unsigned i = 1; i <= numberOfOperatingDaysPassed; i++) {
+ for (unsigned i = 1; i <= operatingDatesWindowLong; i++) {
double daysToSubtract = Seconds::fromHours(24 * i).value();
daysAgoInSeconds = WallTime::now().secondsSinceEpoch().value() - daysToSubtract;
auto dateToInsert = OperatingDate::fromWallTime(WallTime::fromRawSeconds(daysAgoInSeconds));
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -128,7 +128,7 @@
Vector<RegistrableDomain> allDomains() const final;
bool domainIDExistsInDatabase(int);
Optional<Vector<String>> checkForMissingTablesInSchema();
- void insertExpiredStatisticForTesting(const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) override;
+ void insertExpiredStatisticForTesting(const RegistrableDomain&, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) override;
void interrupt();
// Private Click Measurement.
@@ -291,8 +291,7 @@
PAL::SessionID m_sessionID;
bool m_isNewResourceLoadStatisticsDatabaseFile { false };
unsigned m_operatingDatesSize { 0 };
- Optional<OperatingDate> m_longWindowOperatingDate;
- Optional<OperatingDate> m_shortWindowOperatingDate;
+ OperatingDate m_leastRecentOperatingDate;
OperatingDate m_mostRecentOperatingDate;
};
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1137,11 +1137,11 @@
return hasStatisticsExpired(resourceStatistic.mostRecentUserInteractionTime, operatingDatesWindow);
}
-void ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, unsigned numberOfOperatingDaysPassed, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
+void ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
{
// Populate the Operating Dates table with enough days to require pruning.
double daysAgoInSeconds = 0;
- for (unsigned i = 1; i <= numberOfOperatingDaysPassed; i++) {
+ for (unsigned i = 1; i <= operatingDatesWindowLong; i++) {
double daysToSubtract = Seconds::fromHours(24 * i).value();
daysAgoInSeconds = WallTime::now().secondsSinceEpoch().value() - daysToSubtract;
auto dateToInsert = OperatingDate::fromWallTime(WallTime::fromRawSeconds(daysAgoInSeconds));
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -106,7 +106,7 @@
void setLastSeen(const RegistrableDomain&, Seconds) override;
void removeDataForDomain(const RegistrableDomain&) override;
Vector<RegistrableDomain> allDomains() const final;
- void insertExpiredStatisticForTesting(const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) override;
+ void insertExpiredStatisticForTesting(const RegistrableDomain&, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) override;
// Private Click Measurement is not implemented in the ITP memory store.
void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType) override { };
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -201,7 +201,7 @@
virtual void includeTodayAsOperatingDateIfNecessary() = 0;
virtual void clearOperatingDates() = 0;
virtual bool hasStatisticsExpired(WallTime mostRecentUserInteractionTime, OperatingDatesWindow) const = 0;
- virtual void insertExpiredStatisticForTesting(const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool) = 0;
+ virtual void insertExpiredStatisticForTesting(const RegistrableDomain&, bool hasUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool) = 0;
// Private Click Measurement.
virtual void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType) = 0;
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1464,13 +1464,13 @@
suspendedStateChangeCondition.notifyOne();
}
-void WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
+void WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting(const RegistrableDomain& domain, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
{
ASSERT(RunLoop::isMain());
- postTask([this, domain = domain.isolatedCopy(), numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, completionHandler = WTFMove(completionHandler)]() mutable {
+ postTask([this, domain = domain.isolatedCopy(), hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, completionHandler = WTFMove(completionHandler)]() mutable {
if (m_statisticsStore)
- m_statisticsStore->insertExpiredStatisticForTesting(WTFMove(domain), numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent);
+ m_statisticsStore->insertExpiredStatisticForTesting(WTFMove(domain), hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent);
postTaskReply(WTFMove(completionHandler));
});
}
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -304,7 +304,7 @@
static void resume();
bool isEphemeral() const { return m_isEphemeral == WebCore::ResourceLoadStatistics::IsEphemeral::Yes; };
- void insertExpiredStatisticForTesting(const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
+ void insertExpiredStatisticForTesting(const RegistrableDomain&, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
// Private Click Measurement.
void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -950,11 +950,11 @@
}
}
-void NetworkProcess::insertExpiredStatisticForTesting(PAL::SessionID sessionID, const RegistrableDomain& domain, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
+void NetworkProcess::insertExpiredStatisticForTesting(PAL::SessionID sessionID, const RegistrableDomain& domain, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
{
if (auto* networkSession = this->networkSession(sessionID)) {
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
- resourceLoadStatistics->insertExpiredStatisticForTesting(domain, numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, WTFMove(completionHandler));
+ resourceLoadStatistics->insertExpiredStatisticForTesting(domain, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, WTFMove(completionHandler));
else
completionHandler();
} else {
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -243,7 +243,7 @@
void setLastSeen(PAL::SessionID, const RegistrableDomain&, Seconds, CompletionHandler<void()>&&);
void domainIDExistsInDatabase(PAL::SessionID, int domainID, CompletionHandler<void(bool)>&&);
void mergeStatisticForTesting(PAL::SessionID, const RegistrableDomain&, const TopFrameDomain& topFrameDomain1, const TopFrameDomain& topFrameDomain2, Seconds lastSeen, bool hadUserInteraction, Seconds mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, CompletionHandler<void()>&&);
- void insertExpiredStatisticForTesting(PAL::SessionID, const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
+ void insertExpiredStatisticForTesting(PAL::SessionID, const RegistrableDomain&, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
void setMinimumTimeBetweenDataRecordsRemoval(PAL::SessionID, Seconds, CompletionHandler<void()>&&);
void setNotifyPagesWhenDataRecordsWereScanned(PAL::SessionID, bool value, CompletionHandler<void()>&&);
void setIsRunningResourceLoadStatisticsTest(PAL::SessionID, bool value, CompletionHandler<void()>&&);
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-03-01 20:53:49 UTC (rev 273682)
@@ -92,7 +92,7 @@
SetAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds) -> () Async
SetLastSeen(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain, Seconds seconds) -> () Async
MergeStatisticForTesting(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain, WebCore::RegistrableDomain topFrameDomain1, WebCore::RegistrableDomain topFrameDomain2, Seconds lastSeen, bool hadUserInteraction, Seconds mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, uint64_t dataRecordsRemoved) -> () Async
- InsertExpiredStatisticForTesting(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain, uint64_t numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) -> () Async
+ InsertExpiredStatisticForTesting(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent) -> () Async
SetPrevalentResource(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () Async
SetPrevalentResourceForDebugMode(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () Async
IsResourceLoadStatisticsEphemeral(PAL::SessionID sessionID) -> (bool isEphemeral) Async
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -214,10 +214,10 @@
#endif
}
-void WKWebsiteDataStoreSetStatisticsExpiredStatistic(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, void* context, WKWebsiteDataStoreStatisticsMergeStatisticFunction completionHandler)
+void WKWebsiteDataStoreSetStatisticsExpiredStatistic(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, void* context, WKWebsiteDataStoreStatisticsMergeStatisticFunction completionHandler)
{
#if ENABLE(RESOURCE_LOAD_STATISTICS)
- WebKit::toImpl(dataStoreRef)->insertExpiredStatisticForTesting(URL(URL(), WebKit::toImpl(host)->string()), numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, [context, completionHandler] {
+ WebKit::toImpl(dataStoreRef)->insertExpiredStatisticForTesting(URL(URL(), WebKit::toImpl(host)->string()), hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, [context, completionHandler] {
completionHandler(context);
});
#else
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -75,7 +75,7 @@
typedef void (*WKWebsiteDataStoreStatisticsMergeStatisticFunction)(void* functionContext);
WK_EXPORT void WKWebsiteDataStoreSetStatisticsMergeStatistic(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef topFrameDomain1, WKStringRef topFrameDomain2, double lastSeen, bool hadUserInteraction, double mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, void* context, WKWebsiteDataStoreStatisticsMergeStatisticFunction completionHandler);
typedef void (*WKWebsiteDataStoreStatisticsExpiredStatisticFunction)(void* functionContext);
-WK_EXPORT void WKWebsiteDataStoreSetStatisticsExpiredStatistic(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, void* context, WKWebsiteDataStoreStatisticsExpiredStatisticFunction completionHandler);
+WK_EXPORT void WKWebsiteDataStoreSetStatisticsExpiredStatistic(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, void* context, WKWebsiteDataStoreStatisticsExpiredStatisticFunction completionHandler);
typedef void (*WKWebsiteDataStoreStatisticsPrevalentResourceFunction)(void* functionContext);
WK_EXPORT void WKWebsiteDataStoreSetStatisticsPrevalentResource(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool value, void* context, WKWebsiteDataStoreStatisticsPrevalentResourceFunction completionHandler);
typedef void (*WKWebsiteDataStoreStatisticsVeryPrevalentResourceFunction)(void* functionContext);
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -700,9 +700,9 @@
sendWithAsyncReply(Messages::NetworkProcess::MergeStatisticForTesting(sessionID, resourceDomain, topFrameDomain1, topFrameDomain2, lastSeen, hadUserInteraction, mostRecentUserInteraction, isGrandfathered, isPrevalent, isVeryPrevalent, dataRecordsRemoved), WTFMove(completionHandler));
}
-void NetworkProcessProxy::insertExpiredStatisticForTesting(PAL::SessionID sessionID, const RegistrableDomain& resourceDomain, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
+void NetworkProcessProxy::insertExpiredStatisticForTesting(PAL::SessionID sessionID, const RegistrableDomain& resourceDomain, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
{
- sendWithAsyncReply(Messages::NetworkProcess::InsertExpiredStatisticForTesting(sessionID, resourceDomain, numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent), WTFMove(completionHandler));
+ sendWithAsyncReply(Messages::NetworkProcess::InsertExpiredStatisticForTesting(sessionID, resourceDomain, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent), WTFMove(completionHandler));
}
void NetworkProcessProxy::clearPrevalentResource(PAL::SessionID sessionID, const RegistrableDomain& resourceDomain, CompletionHandler<void()>&& completionHandler)
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -150,7 +150,7 @@
void domainIDExistsInDatabase(PAL::SessionID, int domainID, CompletionHandler<void(bool)>&&);
void statisticsDatabaseHasAllTables(PAL::SessionID, CompletionHandler<void(bool)>&&);
void mergeStatisticForTesting(PAL::SessionID, const RegistrableDomain&, const TopFrameDomain& topFrameDomain1, const TopFrameDomain& topFrameDomain2, Seconds lastSeen, bool hadUserInteraction, Seconds mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, CompletionHandler<void()>&&);
- void insertExpiredStatisticForTesting(PAL::SessionID, const RegistrableDomain&, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
+ void insertExpiredStatisticForTesting(PAL::SessionID, const RegistrableDomain&, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
void setAgeCapForClientSideCookies(PAL::SessionID, Optional<Seconds>, CompletionHandler<void()>&&);
void setCacheMaxAgeCap(PAL::SessionID, Seconds, CompletionHandler<void()>&&);
void setGrandfathered(PAL::SessionID, const RegistrableDomain&, bool isGrandfathered, CompletionHandler<void()>&&);
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1551,7 +1551,7 @@
networkProcess().mergeStatisticForTesting(m_sessionID, WebCore::RegistrableDomain { url }, WebCore::RegistrableDomain { topFrameUrl1 }, WebCore::RegistrableDomain { topFrameUrl2 }, lastSeen, hadUserInteraction, mostRecentUserInteraction, isGrandfathered, isPrevalent, isVeryPrevalent, dataRecordsRemoved, [callbackAggregator] { });
}
-void WebsiteDataStore::insertExpiredStatisticForTesting(const URL& url, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
+void WebsiteDataStore::insertExpiredStatisticForTesting(const URL& url, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&& completionHandler)
{
if (url.protocolIsAbout() || url.isEmpty()) {
completionHandler();
@@ -1560,7 +1560,7 @@
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
- networkProcess().insertExpiredStatisticForTesting(m_sessionID, WebCore::RegistrableDomain { url }, numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, [callbackAggregator] { });
+ networkProcess().insertExpiredStatisticForTesting(m_sessionID, WebCore::RegistrableDomain { url }, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, [callbackAggregator] { });
}
void WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned(bool value, CompletionHandler<void()>&& completionHandler)
Modified: branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -197,7 +197,7 @@
void domainIDExistsInDatabase(int domainID, CompletionHandler<void(bool)>&&);
void statisticsDatabaseHasAllTables(CompletionHandler<void(bool)>&&);
void mergeStatisticForTesting(const URL&, const URL& topFrameUrl1, const URL& topFrameUrl2, Seconds lastSeen, bool hadUserInteraction, Seconds mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, CompletionHandler<void()>&&);
- void insertExpiredStatisticForTesting(const URL&, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
+ void insertExpiredStatisticForTesting(const URL&, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
void setNotifyPagesWhenDataRecordsWereScanned(bool, CompletionHandler<void()>&&);
void setIsRunningResourceLoadStatisticsTest(bool, CompletionHandler<void()>&&);
void setPruneEntriesDownTo(size_t, CompletionHandler<void()>&&);
Modified: branches/safari-611.1.21.2-branch/Tools/ChangeLog (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/ChangeLog 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/ChangeLog 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1,141 +1,23 @@
-2021-03-01 Alan Coon <[email protected]>
+ 2021-02-25 Myles C. Maxfield <[email protected]>
- Cherry-pick r273590. rdar://problem/74881403
+ Unreviewed, reverting r273390 and r273391.
+ https://bugs.webkit.org/show_bug.cgi?id=222449
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
-
- Reviewed by Brent Fulgham and informally by Kate Cheney.
-
- Source/WebKit:
-
- Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html
- http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html
-
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
- (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters):
- Now sets two new member variables:
- - Optional<OperatingDate> m_longWindowOperatingDate
- - Optional<OperatingDate> m_shortWindowOperatingDate
- These are only set if the minimum number of operating days has passed.
- This function no longer sets m_leastRecentOperatingDate.
- (WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
- Now checks against the two new member variables m_longWindowOperatingDate
- and m_shortWindowOperatingDate. This fixes the bug.
- (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
- Test infrastructure. Now takes the new parameter numberOfOperatingDaysPassed
- with which layout tests can control the exact number of operating days
- passed since user interaction.
- * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
- Added m_longWindowOperatingDate and m_shortWindowOperatingDate, and
- removed m_leastRecentOperatingDate since it's no longer used.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
- (WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
- Test infrastructure. The same changes as in the DB store.
- * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
- * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
- (WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
- * NetworkProcess/NetworkProcess.cpp:
- (WebKit::NetworkProcess::insertExpiredStatisticForTesting):
- Test infrastructure.
- * NetworkProcess/NetworkProcess.h:
- * NetworkProcess/NetworkProcess.messages.in:
- * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
- (WKWebsiteDataStoreSetStatisticsExpiredStatistic):
- Test infrastructure.
- * UIProcess/API/C/WKWebsiteDataStoreRef.h:
- * UIProcess/Network/NetworkProcessProxy.cpp:
- (WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/Network/NetworkProcessProxy.h:
- * UIProcess/WebsiteData/WebsiteDataStore.cpp:
- (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
- Test infrastructure.
- * UIProcess/WebsiteData/WebsiteDataStore.h:
-
- Tools:
-
- A new numberOfOperatingDaysPassed parameter was added to
- testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
-
- * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
- * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
- (WTR::TestRunner::setStatisticsExpiredStatistic):
- * WebKitTestRunner/InjectedBundle/TestRunner.h:
- * WebKitTestRunner/TestController.cpp:
- (WTR::TestController::setStatisticsExpiredStatistic):
- * WebKitTestRunner/TestController.h:
- * WebKitTestRunner/TestInvocation.cpp:
- (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
-
- LayoutTests:
-
- Existing test cases now make use of the new numberOfOperatingDaysPassed
- parameter to testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
- A new test case makes sure website data is not deleted below the threshold.
-
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago-expected.txt: Added.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-not-removed-with-user-interaction-6-days-ago.html: Added.
- Sets numberOfOperatingDaysPassed to 6.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-expected.txt.
- * http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-with-user-interaction-7-days-ago.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html.
- Sets numberOfOperatingDaysPassed to 7.
- * http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html:
- Sets numberOfOperatingDaysPassed to 30.
- * platform/wk2/TestExpectations:
- Updated existing expectation with new file name.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+ Didn't fix the extreme test variance, and caused some internal
+ performance bots to hang during testing
- 2021-02-26 John Wilander <[email protected]>
+ Reverted changesets:
- Non-cookie website data not deleted after 7 days of browser use without user interaction
- https://bugs.webkit.org/show_bug.cgi?id=222248
- <rdar://problem/74612589>
+ "MotionMark scores are super sensitive to a single long frame"
+ https://bugs.webkit.org/show_bug.cgi?id=220847
+ https://trac.webkit.org/changeset/273390
- Reviewed by Brent Fulgham and informally by Kate Cheney.
+ "MotionMark scores are super sensitive to a single long frame"
+ https://bugs.webkit.org/show_bug.cgi?id=220847
+ https://trac.webkit.org/changeset/273391
- A new numberOfOperatingDaysPassed parameter was added to
- testRunner.setStatisticsExpiredStatistic() to control the exact
- number of operating days passed since user interaction.
+ * Scripts/webkitpy/benchmark_runner/data/plans/motionmark1.1.plan:
- * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
- * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
- (WTR::TestRunner::setStatisticsExpiredStatistic):
- * WebKitTestRunner/InjectedBundle/TestRunner.h:
- * WebKitTestRunner/TestController.cpp:
- (WTR::TestController::setStatisticsExpiredStatistic):
- * WebKitTestRunner/TestController.h:
- * WebKitTestRunner/TestInvocation.cpp:
- (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
-
- 2021-02-25 Myles C. Maxfield <[email protected]>
-
- Unreviewed, reverting r273390 and r273391.
- https://bugs.webkit.org/show_bug.cgi?id=222449
-
- Didn't fix the extreme test variance, and caused some internal
- performance bots to hang during testing
-
- Reverted changesets:
-
- "MotionMark scores are super sensitive to a single long frame"
- https://bugs.webkit.org/show_bug.cgi?id=220847
- https://trac.webkit.org/changeset/273390
-
- "MotionMark scores are super sensitive to a single long frame"
- https://bugs.webkit.org/show_bug.cgi?id=220847
- https://trac.webkit.org/changeset/273391
-
- * Scripts/webkitpy/benchmark_runner/data/plans/motionmark1.1.plan:
-
2021-02-25 Russell Epstein <[email protected]>
Cherry-pick r273314. rdar://problem/74753323
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2021-03-01 20:53:49 UTC (rev 273682)
@@ -294,7 +294,7 @@
undefined setStatisticsPrevalentResourceForDebugMode(DOMString hostName, object completionHandler);
undefined setStatisticsLastSeen(DOMString hostName, double seconds, object completionHandler);
undefined setStatisticsMergeStatistic(DOMString hostName, DOMString topFrameDomain1, DOMString topFrameDomain2, double lastSeen, boolean hadUserInteraction, double mostRecentUserInteraction, boolean isGrandfathered, boolean isPrevalent, boolean isVeryPrevalent, unsigned long dataRecordsRemoved, object completionHandler);
- undefined setStatisticsExpiredStatistic(DOMString hostName, unsigned long numberOfOperatingDaysPassed, boolean hadUserInteraction, boolean isScheduledForAllButCookieDataRemoval, boolean isPrevalent, object completionHandler);
+ undefined setStatisticsExpiredStatistic(DOMString hostName, boolean hadUserInteraction, boolean isScheduledForAllButCookieDataRemoval, boolean isPrevalent, object completionHandler);
undefined setStatisticsPrevalentResource(DOMString hostName, boolean value, object completionHandler);
undefined setStatisticsVeryPrevalentResource(DOMString hostName, boolean value, object completionHandler);
boolean isStatisticsPrevalentResource(DOMString hostName);
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -1228,13 +1228,12 @@
callTestRunnerCallback(SetStatisticsMergeStatisticCallbackID);
}
-void TestRunner::setStatisticsExpiredStatistic(JSStringRef hostName, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, JSValueRef completionHandler)
+void TestRunner::setStatisticsExpiredStatistic(JSStringRef hostName, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, JSValueRef completionHandler)
{
cacheTestRunnerCallback(SetStatisticsExpiredStatisticCallbackID, completionHandler);
postMessage("SetStatisticsExpiredStatistic", createWKDictionary({
{ "HostName", toWK(hostName) },
- { "NumberOfOperatingDaysPassed", adoptWK(WKUInt64Create(numberOfOperatingDaysPassed)) },
{ "HadUserInteraction", adoptWK(WKBooleanCreate(hadUserInteraction)) },
{ "IsScheduledForAllButCookieDataRemoval", adoptWK(WKBooleanCreate(isScheduledForAllButCookieDataRemoval)) },
{ "IsPrevalent", adoptWK(WKBooleanCreate(isPrevalent)) }
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -386,7 +386,7 @@
void statisticsCallDidSetLastSeenCallback();
void setStatisticsMergeStatistic(JSStringRef hostName, JSStringRef topFrameDomain1, JSStringRef topFrameDomain2, double lastSeen, bool hadUserInteraction, double mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, JSValueRef completionHandler);
void statisticsCallDidSetMergeStatisticCallback();
- void setStatisticsExpiredStatistic(JSStringRef hostName, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, JSValueRef completionHandler);
+ void setStatisticsExpiredStatistic(JSStringRef hostName, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, JSValueRef completionHandler);
void statisticsCallDidSetExpiredStatisticCallback();
void setStatisticsPrevalentResource(JSStringRef hostName, bool value, JSValueRef completionHandler);
void statisticsCallDidSetPrevalentResourceCallback();
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -3063,10 +3063,10 @@
m_currentInvocation->didMergeStatistic();
}
-void TestController::setStatisticsExpiredStatistic(WKStringRef host, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
+void TestController::setStatisticsExpiredStatistic(WKStringRef host, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent)
{
ResourceStatisticsCallbackContext context(*this);
- WKWebsiteDataStoreSetStatisticsExpiredStatistic(websiteDataStore(), host, numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, &context, resourceStatisticsVoidResultCallback);
+ WKWebsiteDataStoreSetStatisticsExpiredStatistic(websiteDataStore(), host, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent, &context, resourceStatisticsVoidResultCallback);
runUntil(context.done, noTimeout);
m_currentInvocation->didSetExpiredStatistic();
}
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.h (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.h 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestController.h 2021-03-01 20:53:49 UTC (rev 273682)
@@ -214,7 +214,7 @@
void setStatisticsPrevalentResourceForDebugMode(WKStringRef hostName);
void setStatisticsLastSeen(WKStringRef hostName, double seconds);
void setStatisticsMergeStatistic(WKStringRef host, WKStringRef topFrameDomain1, WKStringRef topFrameDomain2, double lastSeen, bool hadUserInteraction, double mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, int dataRecordsRemoved);
- void setStatisticsExpiredStatistic(WKStringRef host, unsigned numberOfOperatingDaysPassed, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent);
+ void setStatisticsExpiredStatistic(WKStringRef host, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent);
void setStatisticsPrevalentResource(WKStringRef hostName, bool value);
void setStatisticsVeryPrevalentResource(WKStringRef hostName, bool value);
String dumpResourceLoadStatistics();
Modified: branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestInvocation.cpp (273681 => 273682)
--- branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestInvocation.cpp 2021-03-01 20:51:19 UTC (rev 273681)
+++ branches/safari-611.1.21.2-branch/Tools/WebKitTestRunner/TestInvocation.cpp 2021-03-01 20:53:49 UTC (rev 273682)
@@ -677,11 +677,10 @@
if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsExpiredStatistic")) {
auto messageBodyDictionary = dictionaryValue(messageBody);
auto hostName = stringValue(messageBodyDictionary, "HostName");
- auto numberOfOperatingDaysPassed = uint64Value(messageBodyDictionary, "NumberOfOperatingDaysPassed");
auto hadUserInteraction = booleanValue(messageBodyDictionary, "HadUserInteraction");
auto isScheduledForAllButCookieDataRemoval = booleanValue(messageBodyDictionary, "IsScheduledForAllButCookieDataRemoval");
auto isPrevalent = booleanValue(messageBodyDictionary, "IsPrevalent");
- TestController::singleton().setStatisticsExpiredStatistic(hostName, numberOfOperatingDaysPassed, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent);
+ TestController::singleton().setStatisticsExpiredStatistic(hostName, hadUserInteraction, isScheduledForAllButCookieDataRemoval, isPrevalent);
return;
}