Unreviewed, rolling out r227875.
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Feb 2018 00:08:01 +0000 (00:08 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Feb 2018 00:08:01 +0000 (00:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182357

Missing cross-platform TestController implementation

Reverted changeset:

"Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
https://bugs.webkit.org/show_bug.cgi?id=181958
https://trac.webkit.org/changeset/227875

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
(WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
(WebKit::WebResourceLoadStatisticsStore::clearInMemory):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
(WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsUpdateCookiePartitioning):
(WTR::TestRunner::statisticsSetShouldPartitionCookiesForHost):
(WTR::TestRunner::statisticsCallDidSetPartitionOrBlockCookiesForHostCallback): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didSetPartitionOrBlockCookiesForHost): Deleted.
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::statisticsUpdateCookiePartitioning):
(WTR::TestController::statisticsSetShouldPartitionCookiesForHost):

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* platform/mac-wk2/TestExpectations:

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

30 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

index ad29fe6..2374c5f 100644 (file)
@@ -1,3 +1,32 @@
+2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r227875.
+        https://bugs.webkit.org/show_bug.cgi?id=182357
+
+        Missing cross-platform TestController implementation
+
+        Reverted changeset:
+
+        "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
+        https://bugs.webkit.org/show_bug.cgi?id=181958
+        https://trac.webkit.org/changeset/227875
+
+        * http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
+        * http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
+        * http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
+        * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
+        * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
+        * http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
+        * http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
+        * http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
+        * http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
+        * platform/mac-wk2/TestExpectations:
+
 2018-01-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
index 3386c57..53a1e75 100644 (file)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+
 
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
index 0666eff..c33ec08 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <script src="/js-test-resources/js-test.js"></script>
 </head>
-<body>
+<body onload="runTest()">
 <script>
     description("Tests that blocking is added mid-flight in redirects.");
     jsTestIsAsync = true;
         testRunner.setCookieStoragePartitioningEnabled(enable);
     }
 
+    if (document.location.hash === "") {
+        setEnableFeature(true);
+        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
+            testFailed("Localhost was classified as prevalent resource before the test starts.");
+        // Make sure the network process is up-to-date.
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false);
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
+    }
+
     const partitionHost = "127.0.0.1:8000";
     const thirdPartyOrigin = "http://localhost:8000";
     const resourcePath = "/resourceLoadStatistics/resources";
                 // Set localhost as prevalent and with no user interaction to put it in the blocking category.
                 document.location.hash = "step5";
                 testRunner.setStatisticsPrevalentResource("http://localhost", true);
+                testRunner.statisticsUpdateCookiePartitioning();
                 if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
                     testFailed("Host did not get set as prevalent resource.");
-                testRunner.statisticsUpdateCookiePartitioning(function() {
-                    runTest();
-                });
+                runTest();
                 break;
             case "#step5":
                 // Check that no cookie gets sent for localhost under 127.0.0.1 since localhost's cookies are blocked.
                 break;
         }
     }
-
-    if (document.location.hash === "") {
-        setEnableFeature(true);
-        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
-            testFailed("Localhost was classified as prevalent resource before the test starts.");
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-        // Make sure the network process is up-to-date.
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
-    } else {
-        runTest();
-    }
 </script>
 </body>
 </html>
index 4f636db..88592ed 100644 (file)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+
 
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
index 7c5f9fe..7412921 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <script src="/js-test-resources/js-test.js"></script>
 </head>
-<body>
+<body onload="runTest()">
 <script>
     description("Tests that partitioning is added mid-flight in redirects.");
     jsTestIsAsync = true;
         testRunner.setCookieStoragePartitioningEnabled(enable);
     }
 
+    if (document.location.hash === "") {
+        setEnableFeature(true);
+        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
+            testFailed("Localhost was classified as prevalent resource before the test starts.");
+        // Make sure the network process is up-to-date.
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false);
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
+    }
+
     const partitionHost = "127.0.0.1:8000";
     const thirdPartyOrigin = "http://localhost:8000";
     const resourcePath = "/resourceLoadStatistics/resources";
                 // Set localhost as prevalent and with non-recent user interaction to put it in the partitioning category.
                 document.location.hash = "step5";
                 testRunner.setStatisticsPrevalentResource("http://localhost", true);
+                testRunner.setStatisticsHasHadNonRecentUserInteraction("http://localhost");
+                testRunner.statisticsUpdateCookiePartitioning();
                 if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
                     testFailed("Host did not get set as prevalent resource.");
-                testRunner.setStatisticsHasHadNonRecentUserInteraction("http://localhost");
-                testRunner.statisticsUpdateCookiePartitioning(function() {
-                    runTest();
-                });
+                runTest();
                 break;
             case "#step5":
                 // Check that no cookie gets sent for localhost under 127.0.0.1 since localhost is partitioned.
                 break;
         }
     }
-
-    if (document.location.hash === "") {
-        setEnableFeature(true);
-        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
-            testFailed("Localhost was classified as prevalent resource before the test started.");
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-        // Make sure the network process is up-to-date.
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
-    } else {
-        runTest();
-    }
 </script>
 </body>
 </html>
index b8df5ae..787d7b9 100644 (file)
                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive one cookie.", runTest);
                 break;
             case "#step3":
-                // Setup localhost for partitioning.
+                // Setup localhost for partitioning and set a partitioned cookie for localhost under 127.0.0.1.
                 document.location.hash = "step4";
-                testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, true, runTest);
+                testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, true);
+                openIframe(thirdPartyBaseUrl + subPathToSetPartitionedCookie + "&message=Setting partitioned, third party cookie.", runTest);
                 break;
             case "#step4":
-                // Set a partitioned cookie for localhost under 127.0.0.1.
+                // Load localhost under 127.0.0.1 and check that it gets only the partitioned cookie. End by aquiring user interaction for localhost.
                 document.location.hash = "step5";
-                openIframe(thirdPartyBaseUrl + subPathToSetPartitionedCookie + "&message=Setting partitioned, third party cookie.", runTest);
-                break;
-            case "#step5":
-                // Load localhost under 127.0.0.1 and check that it gets only the partitioned cookie. End by acquiring user interaction for localhost.
-                document.location.hash = "step6";
                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive one partitioned, third party cookie.", setUserInteractionAndContinue);
                 break;
-            case "#step6":
+            case "#step5":
                 // Load localhost under 127.0.0.1 and check that it gets its non-partitioned cookie after user interaction.
                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should receive one non-partitioned, first party cookie.", finishTest);
                 break;
 
         testRunner.setStatisticsPrevalentResource(thirdPartyHostname, false);
         testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, false);
+        testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false);
+
         testRunner.waitUntilDone();
         testRunner.dumpChildFramesAsText();
         document.location.hash = "step1";
-
-        testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false, runTest);
-    } else {
-        runTest();
     }
+
+    runTest();
 </script>
 </body>
 </html>
index 26461a4..a60007c 100644 (file)
         }
     }
 
+
     if (document.location.host === partitionHost && document.location.hash === "" && window.testRunner && window.internals) {
         setEnableFeature(true);
 
         testRunner.setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(false);
         testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(0);
 
-        testRunner.waitUntilDone();
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", true);
         testRunner.setStatisticsPrevalentResource("http://localhost", true);
         if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
             testFailed("Host did not get set as prevalent resource.");
 
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", true, runTest);
-    } else {
-        runTest();
+        testRunner.waitUntilDone();
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
     }
 
+    runTest();
 </script>
 </body>
 </html>
index ad5e975..01b3708 100644 (file)
@@ -40,7 +40,8 @@
     }
 
     function fireShouldPartitionCookiesHandlerAndContinue() {
-        testRunner.statisticsUpdateCookiePartitioning(runTest);
+        testRunner.statisticsUpdateCookiePartitioning();
+        runTest();
     }
 
     function setShortCookiePartitioningTimeOutPlusFireShouldPartitionCookiesHandlerAndContinue() {
index 0fdedc2..3403495 100644 (file)
@@ -5,7 +5,7 @@
     <title>Test for Partitioned Cookies With and Without User Interaction</title>
     <script src="../../resources/js-test-pre.js"></script>
 </head>
-<body>
+<body onload="runTest()">
 <script>
     const partitionHost = "127.0.0.1:8000";
     const thirdPartyOrigin = "http://localhost:8000";
     if (document.location.host === partitionHost && document.location.hash == "" && window.testRunner && window.internals) {
         setEnableFeature(true);
 
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", true);
+
         testRunner.waitUntilDone();
         testRunner.dumpChildFramesAsText();
         document.location.hash = "step1";
-
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", true, runTest);
-    } else {
-        runTest();
     }
 </script>
 </body>
index f23a656..8fa51fa 100644 (file)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+
 
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
index cd7046d..f771870 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <script src="/js-test-resources/js-test.js"></script>
 </head>
-<body>
+<body onload="runTest()">
 <script>
     description("Tests that blocking is removed mid-flight in redirects.");
     jsTestIsAsync = true;
         testRunner.setCookieStoragePartitioningEnabled(enable);
     }
 
+    if (document.location.hash === "") {
+        setEnableFeature(true);
+        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
+            testFailed("Localhost was classified as prevalent resource before the test starts.");
+        // Make sure the network process is up-to-date.
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false);
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
+    }
+
     const partitionHost = "127.0.0.1:8000";
     const thirdPartyOrigin = "http://localhost:8000";
     const resourcePath = "/resourceLoadStatistics/resources";
                 // Set localhost as prevalent and with non-recent user interaction to put it in the blocking category.
                 document.location.hash = "step5";
                 testRunner.setStatisticsPrevalentResource("http://localhost", true);
+                testRunner.statisticsUpdateCookiePartitioning();
                 if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
                     testFailed("Host did not get set as prevalent resource.");
-                testRunner.statisticsUpdateCookiePartitioning(function() {
-                    runTest();
-                });
+                runTest();
                 break;
             case "#step5":
                 // Set partitioned cookie for localhost under 127.0.0.1.
                 break;
         }
     }
-
-    if (document.location.hash === "") {
-        setEnableFeature(true);
-        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
-            testFailed("Localhost was classified as prevalent resource before the test starts.");
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-        // Make sure the network process is up-to-date.
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
-    } else {
-        runTest();
-    }
 </script>
 </body>
 </html>
index f9527ad..95a3ff0 100644 (file)
@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+
 
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
index aed5cf4..805e7d5 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <script src="/js-test-resources/js-test.js"></script>
 </head>
-<body>
+<body onload="runTest()">
 <script>
     description("Tests that partitioning is removed mid-flight in redirects.");
     jsTestIsAsync = true;
         testRunner.setCookieStoragePartitioningEnabled(enable);
     }
 
+    if (document.location.hash === "") {
+        setEnableFeature(true);
+        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
+            testFailed("Localhost was classified as prevalent resource before the test starts.");
+        // Make sure the network process is up-to-date.
+        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false);
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
+    }
+
     const partitionHost = "127.0.0.1:8000";
     const thirdPartyOrigin = "http://localhost:8000";
     const resourcePath = "/resourceLoadStatistics/resources";
                 // Set localhost as prevalent and with non-recent user interaction to put it in the partitioning category.
                 document.location.hash = "step5";
                 testRunner.setStatisticsPrevalentResource("http://localhost", true);
+                testRunner.setStatisticsHasHadNonRecentUserInteraction("http://localhost");
+                testRunner.statisticsUpdateCookiePartitioning();
                 if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
                     testFailed("Host did not get set as prevalent resource.");
-                testRunner.setStatisticsHasHadNonRecentUserInteraction("http://localhost");
-                testRunner.statisticsUpdateCookiePartitioning(function() {
-                    runTest();
-                });
+                runTest();
                 break;
             case "#step5":
                 // Set partitioned cookie for localhost under 127.0.0.1.
                 break;
         }
     }
-
-    if (document.location.hash === "") {
-        setEnableFeature(true);
-        if (testRunner.isStatisticsPrevalentResource("http://localhost"))
-            testFailed("Localhost was classified as prevalent resource before the test starts.");
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-        // Make sure the network process is up-to-date.
-        testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
-    } else {
-        runTest();
-    }
 </script>
 </body>
 </html>
index 84fdc97..733050f 100644 (file)
             case "#step4":
                 // Flag localhost for partitioning and set a partitioned cookie.
                 document.location.hash = "step5";
-                testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, true, runTest);
+                testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, true);
+                openIframe(thirdPartyBaseUrl + subPathToSetPartitionedThirdPartyCookie + "&message=Setting partitioned, third party cookie.", runTest);
                 break;
             case "#step5":
-                // Flag localhost for partitioning and set a partitioned cookie.
                 document.location.hash = "step6";
-                openIframe(thirdPartyBaseUrl + subPathToSetPartitionedThirdPartyCookie + "&message=Setting partitioned, third party cookie.", runTest);
-                break;
-            case "#step6":
-                document.location.hash = "step7";
                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should only receive partitioned, third party cookie.", setUserInteractionAndContinue);
                 break;
-            case "#step7":
+            case "#step6":
                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should receive non-partitioned cookies set in a first-party context and in a third-party context.", finishTest);
                 break;
         }
     if (document.location.host === partitionHost && document.location.hash == "" && window.testRunner && window.internals) {
         setEnableFeature(true);
 
-        testRunner.waitUntilDone();
-        testRunner.dumpChildFramesAsText();
-        document.location.hash = "step1";
-
         // Start test with third party as non-prevalent
         testRunner.setStatisticsPrevalentResource(thirdPartyHostname, false);
         testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, false);
-        testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false, runTest);
-    } else {
-        runTest();
+        testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false);
+
+        testRunner.waitUntilDone();
+        testRunner.dumpChildFramesAsText();
+        document.location.hash = "step1";
     }
+
+    runTest();
 </script>
 </body>
 </html>
index caa6c20..59f956e 100644 (file)
@@ -804,13 +804,13 @@ webkit.org/b/176122 media/video-controls-drop-and-restore-timeline.html [ Pass F
 [ HighSierra+ ] http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html [ Pass Timeout ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html [ Pass ]
-[ HighSierra+ ] http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/add-blocking-to-redirect.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html [ Pass ]
 [ HighSierra+ ] http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html [ Pass ]
-[ HighSierra+ ] http/tests/resourceLoadStatistics/grandfathering.html [ Pass ]
+
+webkit.org/b/181958 [ HighSierra+ ] http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html [ Pass Failure ]
 
 # <rdar://problem/33555759>
 webkit.org/b/177616 [ HighSierra+ ] http/tests/media/video-buffered-range-contains-currentTime.html [ Pass Timeout ]
@@ -875,6 +875,8 @@ webkit.org/b/181839 [ Debug ] inspector/debugger/breakpoint-action-log.html [ Pa
 
 webkit.org/b/181753 [ HighSierra Release ] http/wpt/service-workers/update-service-worker.https.html [ Pass Failure ]
 
+webkit.org/b/181831 [ HighSierra ] fast/forms/searchfield-heights.html [ Pass Failure ]
+
 webkit.org/b/181957 [ Release ] http/tests/misc/resource-timing-resolution.html [ Pass Failure ]
 
 webkit.org/b/181835 webrtc/captureCanvas-webrtc.html [ Pass Timeout ]
index feae2dd..7c1485a 100644 (file)
@@ -1,3 +1,39 @@
+2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r227875.
+        https://bugs.webkit.org/show_bug.cgi?id=182357
+
+        Missing cross-platform TestController implementation
+
+        Reverted changeset:
+
+        "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
+        https://bugs.webkit.org/show_bug.cgi?id=181958
+        https://trac.webkit.org/changeset/227875
+
+        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
+        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
+        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
+        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
+        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
+        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
+        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
+        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
+        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
+        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
+        (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
+        (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
+        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
+        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
+        (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
+        * UIProcess/WebResourceLoadStatisticsStore.h:
+
 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
 
         Follow-up to r227939.
index a6bd2b0..49f34f7 100644 (file)
@@ -244,7 +244,7 @@ void WKWebsiteDataStoreStatisticsUpdateCookiePartitioning(WKWebsiteDataStoreRef
     if (!store)
         return;
 
-    store->scheduleCookiePartitioningUpdate([]() { });
+    store->scheduleCookiePartitioningUpdate();
 }
 
 void WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool value)
@@ -254,9 +254,9 @@ void WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost(WKWebsiteDataS
         return;
 
     if (value)
-        store->scheduleCookiePartitioningUpdateForDomains({ WebKit::toImpl(host)->string() }, { }, { }, WebKit::ShouldClearFirst::No, []() { });
+        store->scheduleCookiePartitioningUpdateForDomains({ WebKit::toImpl(host)->string() }, { }, { }, WebKit::ShouldClearFirst::No);
     else
-        store->scheduleClearPartitioningStateForDomains({ WebKit::toImpl(host)->string() }, []() { });
+        store->scheduleClearPartitioningStateForDomains({ WebKit::toImpl(host)->string() });
 }
 
 void WKWebsiteDataStoreStatisticsSubmitTelemetry(WKWebsiteDataStoreRef dataStoreRef)
index d4eeb9f..c1f1510 100644 (file)
@@ -497,43 +497,23 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
 
 - (void)_resourceLoadStatisticsUpdateCookiePartitioning
 {
-    [self _resourceLoadStatisticsUpdateCookiePartitioning:^() { }];
-}
-
-- (void)_resourceLoadStatisticsUpdateCookiePartitioning:(void (^)())completionHandler
-{
     auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
-    if (!store) {
-        completionHandler();
+    if (!store)
         return;
-    }
-    
-    store->scheduleCookiePartitioningUpdate([completionHandler = makeBlockPtr(completionHandler)]() {
-        completionHandler();
-    });
-}
 
-- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host
-{
-    [self _resourceLoadStatisticsSetShouldPartitionCookies:value forHost:host completionHandler:^() { }];
+    store->scheduleCookiePartitioningUpdate();
 }
 
-- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host completionHandler:(void (^)())completionHandler
+- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host
 {
     auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
-    if (!store) {
-        completionHandler();
+    if (!store)
         return;
-    }
 
     if (value)
-        store->scheduleCookiePartitioningUpdateForDomains({ host }, { }, { }, WebKit::ShouldClearFirst::No, [completionHandler = makeBlockPtr(completionHandler)]() {
-            completionHandler();
-        });
+        store->scheduleCookiePartitioningUpdateForDomains({ host }, { }, { }, WebKit::ShouldClearFirst::No);
     else
-        store->scheduleClearPartitioningStateForDomains({ host }, [completionHandler = makeBlockPtr(completionHandler)]() {
-            completionHandler();
-        });
+        store->scheduleClearPartitioningStateForDomains({ host });
 }
 
 - (void)_resourceLoadStatisticsSubmitTelemetry
index d0beadf..2ef1c86 100644 (file)
@@ -73,10 +73,8 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
 - (void)_resourceLoadStatisticsSetMaxStatisticsEntries:(size_t)entries WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_resourceLoadStatisticsSetPruneEntriesDownTo:(size_t)entries WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_resourceLoadStatisticsProcessStatisticsAndDataRecords WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-- (void)_resourceLoadStatisticsUpdateCookiePartitioning WK_API_DEPRECATED_WITH_REPLACEMENT("_resourceLoadStatisticsUpdateCookiePartitioning", macosx(10.13, WK_MAC_TBA), ios(11.0, WK_IOS_TBA));
-- (void)_resourceLoadStatisticsUpdateCookiePartitioning:(void (^)(void))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host WK_API_DEPRECATED_WITH_REPLACEMENT("_resourceLoadStatisticsSetShouldPartitionCookies", macosx(10.13, WK_MAC_TBA), ios(11.0, WK_IOS_TBA));
-- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host completionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_resourceLoadStatisticsUpdateCookiePartitioning WK_API_AVAILABLE(macosx(10.13), ios(11.0));
+- (void)_resourceLoadStatisticsSetShouldPartitionCookies:(BOOL)value forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_resourceLoadStatisticsSubmitTelemetry WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:(BOOL)value WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 - (void)_resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:(BOOL)value WK_API_AVAILABLE(macosx(10.13), ios(11.0));
index d4b823b..88e99d9 100644 (file)
@@ -254,7 +254,7 @@ void WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated(Vector<WebCor
 
     mergeStatistics(WTFMove(origins));
     // Fire before processing statistics to propagate user interaction as fast as possible to the network process.
-    updateCookiePartitioning([]() { });
+    updateCookiePartitioning();
     processStatisticsAndDataRecords();
 }
 
@@ -386,7 +386,7 @@ void WebResourceLoadStatisticsStore::logUserInteraction(const URL& url)
         statistics.mostRecentUserInteractionTime = WallTime::now();
 
         if (statistics.isMarkedForCookiePartitioning || statistics.isMarkedForCookieBlocking)
-            updateCookiePartitioningForDomains({ }, { }, { primaryDomain }, ShouldClearFirst::No, []() { });
+            updateCookiePartitioningForDomains({ }, { }, { primaryDomain }, ShouldClearFirst::No);
     });
 }
 
@@ -400,7 +400,7 @@ void WebResourceLoadStatisticsStore::logNonRecentUserInteraction(const URL& url)
         statistics.hadUserInteraction = true;
         statistics.mostRecentUserInteractionTime = WallTime::now() - (m_parameters.timeToLiveCookiePartitionFree + Seconds::fromHours(1));
 
-        updateCookiePartitioningForDomains({ primaryDomain }, { }, { }, ShouldClearFirst::No, []() { });
+        updateCookiePartitioningForDomains({ primaryDomain }, { }, { }, ShouldClearFirst::No);
     });
 }
 
@@ -563,31 +563,31 @@ void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo(const URL& s
     });
 }
 
-void WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate(CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate()
 {
     // Helper function used by testing system. Should only be called from the main thread.
     ASSERT(RunLoop::isMain());
 
-    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), callback = WTFMove(callback)] () mutable {
-        updateCookiePartitioning(WTFMove(callback));
+    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this)] {
+        updateCookiePartitioning();
     });
 }
 
-void WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst, CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst)
 {
     // Helper function used by testing system. Should only be called from the main thread.
     ASSERT(RunLoop::isMain());
-    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domainsToPartition = crossThreadCopy(domainsToPartition), domainsToBlock = crossThreadCopy(domainsToBlock), domainsToNeitherPartitionNorBlock = crossThreadCopy(domainsToNeitherPartitionNorBlock), shouldClearFirst, callback = WTFMove(callback)] () mutable {
-        updateCookiePartitioningForDomains(domainsToPartition, domainsToBlock, domainsToNeitherPartitionNorBlock, shouldClearFirst, WTFMove(callback));
+    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domainsToPartition = crossThreadCopy(domainsToPartition), domainsToBlock = crossThreadCopy(domainsToBlock), domainsToNeitherPartitionNorBlock = crossThreadCopy(domainsToNeitherPartitionNorBlock), shouldClearFirst] {
+        updateCookiePartitioningForDomains(domainsToPartition, domainsToBlock, domainsToNeitherPartitionNorBlock, shouldClearFirst);
     });
 }
 
-void WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains(const Vector<String>& domains)
 {
     // Helper function used by testing system. Should only be called from the main thread.
     ASSERT(RunLoop::isMain());
-    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domains = crossThreadCopy(domains), callback = WTFMove(callback)] () mutable {
-        clearPartitioningStateForDomains(domains, WTFMove(callback));
+    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domains = crossThreadCopy(domains)] {
+        clearPartitioningStateForDomains(domains);
     });
 }
 
@@ -732,7 +732,7 @@ void WebResourceLoadStatisticsStore::mergeWithDataFromDecoder(KeyedDecoder& deco
         return;
 
     mergeStatistics(WTFMove(loadedStatistics));
-    updateCookiePartitioning([]() { });
+    updateCookiePartitioning();
 
     Vector<OperatingDate> operatingDates;
     succeeded = decoder.decodeObjects("operatingDates", operatingDates, [](KeyedDecoder& decoder, OperatingDate& date) {
@@ -756,7 +756,7 @@ void WebResourceLoadStatisticsStore::clearInMemory()
     m_resourceStatisticsMap.clear();
     m_operatingDates.clear();
 
-    updateCookiePartitioningForDomains({ }, { }, { }, ShouldClearFirst::Yes, []() { });
+    updateCookiePartitioningForDomains({ }, { }, { }, ShouldClearFirst::Yes);
 }
 
 bool WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction(const ResourceLoadStatistics& current, const ResourceLoadStatistics& updated)
@@ -794,7 +794,7 @@ bool WebResourceLoadStatisticsStore::shouldBlockCookies(const ResourceLoadStatis
     return statistic.isPrevalentResource && !statistic.hadUserInteraction;
 }
 
-void WebResourceLoadStatisticsStore::updateCookiePartitioning(CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::updateCookiePartitioning()
 {
     ASSERT(!RunLoop::isMain());
 
@@ -819,25 +819,20 @@ void WebResourceLoadStatisticsStore::updateCookiePartitioning(CompletionHandler<
         }
     }
 
-    if (domainsToPartition.isEmpty() && domainsToBlock.isEmpty() && domainsToNeitherPartitionNorBlock.isEmpty()) {
-        callback();
+    if (domainsToPartition.isEmpty() && domainsToBlock.isEmpty() && domainsToNeitherPartitionNorBlock.isEmpty())
         return;
-    }
 
-    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), domainsToPartition = crossThreadCopy(domainsToPartition), domainsToBlock = crossThreadCopy(domainsToBlock), domainsToNeitherPartitionNorBlock = crossThreadCopy(domainsToNeitherPartitionNorBlock), callback = WTFMove(callback)] () {
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), domainsToPartition = crossThreadCopy(domainsToPartition), domainsToBlock = crossThreadCopy(domainsToBlock), domainsToNeitherPartitionNorBlock = crossThreadCopy(domainsToNeitherPartitionNorBlock)] () {
         m_updatePrevalentDomainsToPartitionOrBlockCookiesHandler(domainsToPartition, domainsToBlock, domainsToNeitherPartitionNorBlock, ShouldClearFirst::No);
-        callback();
     });
 }
 
-void WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst, CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst)
 {
     ASSERT(!RunLoop::isMain());
-    if (domainsToPartition.isEmpty() && domainsToBlock.isEmpty() && domainsToNeitherPartitionNorBlock.isEmpty() && shouldClearFirst == ShouldClearFirst::No) {
-        callback();
+    if (domainsToPartition.isEmpty() && domainsToBlock.isEmpty() && domainsToNeitherPartitionNorBlock.isEmpty() && shouldClearFirst == ShouldClearFirst::No)
         return;
-    }
-    
+
     RunLoop::main().dispatch([this, shouldClearFirst, protectedThis = makeRef(*this), domainsToPartition = crossThreadCopy(domainsToPartition), domainsToBlock = crossThreadCopy(domainsToBlock), domainsToNeitherPartitionNorBlock = crossThreadCopy(domainsToNeitherPartitionNorBlock)] () {
         m_updatePrevalentDomainsToPartitionOrBlockCookiesHandler(domainsToPartition, domainsToBlock, domainsToNeitherPartitionNorBlock, shouldClearFirst);
     });
@@ -857,17 +852,13 @@ void WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(const Ve
 
     for (auto& domain : domainsToBlock)
         ensureResourceStatisticsForPrimaryDomain(domain).isMarkedForCookieBlocking = true;
-
-    callback();
 }
 
-void WebResourceLoadStatisticsStore::clearPartitioningStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&& callback)
+void WebResourceLoadStatisticsStore::clearPartitioningStateForDomains(const Vector<String>& domains)
 {
     ASSERT(!RunLoop::isMain());
-    if (domains.isEmpty()) {
-        callback();
+    if (domains.isEmpty())
         return;
-    }
 
     RunLoop::main().dispatch([this, protectedThis = makeRef(*this), domains = crossThreadCopy(domains)] () {
         m_removeDomainsHandler(domains);
@@ -878,8 +869,6 @@ void WebResourceLoadStatisticsStore::clearPartitioningStateForDomains(const Vect
         statistic.isMarkedForCookiePartitioning = false;
         statistic.isMarkedForCookieBlocking = false;
     }
-
-    callback();
 }
 
 void WebResourceLoadStatisticsStore::resetCookiePartitioningState()
index bd211b5..5cfd21c 100644 (file)
@@ -106,9 +106,9 @@ public:
     void setSubframeUnderTopFrameOrigin(const WebCore::URL& subframe, const WebCore::URL& topFrame);
     void setSubresourceUnderTopFrameOrigin(const WebCore::URL& subresource, const WebCore::URL& topFrame);
     void setSubresourceUniqueRedirectTo(const WebCore::URL& subresource, const WebCore::URL& hostNameRedirectedTo);
-    void scheduleCookiePartitioningUpdate(CompletionHandler<void()>&&);
-    void scheduleCookiePartitioningUpdateForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst, CompletionHandler<void()>&&);
-    void scheduleClearPartitioningStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&&);
+    void scheduleCookiePartitioningUpdate();
+    void scheduleCookiePartitioningUpdateForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst);
+    void scheduleClearPartitioningStateForDomains(const Vector<String>& domains);
     void scheduleStatisticsAndDataRecordsProcessing();
     void submitTelemetry();
     void scheduleCookiePartitioningStateReset();
@@ -162,9 +162,9 @@ private:
     bool hasHadUnexpiredRecentUserInteraction(WebCore::ResourceLoadStatistics&) const;
     void includeTodayAsOperatingDateIfNecessary();
     Vector<String> topPrivatelyControlledDomainsToRemoveWebsiteDataFor();
-    void updateCookiePartitioning(CompletionHandler<void()>&&);
-    void updateCookiePartitioningForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst, CompletionHandler<void()>&&);
-    void clearPartitioningStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&&);
+    void updateCookiePartitioning();
+    void updateCookiePartitioningForDomains(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst);
+    void clearPartitioningStateForDomains(const Vector<String>& domains);
     void mergeStatistics(Vector<WebCore::ResourceLoadStatistics>&&);
     WebCore::ResourceLoadStatistics& ensureResourceStatisticsForPrimaryDomain(const String&);
     void processStatisticsAndDataRecords();
index 0e3bb16..3302290 100644 (file)
@@ -1,5 +1,33 @@
 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        Unreviewed, rolling out r227875.
+        https://bugs.webkit.org/show_bug.cgi?id=182357
+
+        Missing cross-platform TestController implementation
+
+        Reverted changeset:
+
+        "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
+        https://bugs.webkit.org/show_bug.cgi?id=181958
+        https://trac.webkit.org/changeset/227875
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::didReceiveMessageToPage):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::statisticsUpdateCookiePartitioning):
+        (WTR::TestRunner::statisticsSetShouldPartitionCookiesForHost):
+        (WTR::TestRunner::statisticsCallDidSetPartitionOrBlockCookiesForHostCallback): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didSetPartitionOrBlockCookiesForHost): Deleted.
+        * WebKitTestRunner/TestInvocation.h:
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::statisticsUpdateCookiePartitioning):
+        (WTR::TestController::statisticsSetShouldPartitionCookiesForHost):
+
+2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
         https://bugs.webkit.org/show_bug.cgi?id=182222
 
index 1ed7af0..a3ea375 100644 (file)
@@ -283,8 +283,8 @@ interface TestRunner {
     void setStatisticsTimeToLiveCookiePartitionFree(double seconds);
     void statisticsNotifyObserver();
     void statisticsProcessStatisticsAndDataRecords();
-    void statisticsUpdateCookiePartitioning(object callback);
-    void statisticsSetShouldPartitionCookiesForHost(DOMString hostName, boolean value, object callback);
+    void statisticsUpdateCookiePartitioning();
+    void statisticsSetShouldPartitionCookiesForHost(DOMString hostName, boolean value);
     void statisticsSubmitTelemetry();
     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(boolean value);
     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(boolean value);
index 72ea3d2..3de38c3 100644 (file)
@@ -245,11 +245,6 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m
         return;
     }
 
-    if (WKStringIsEqualToUTF8CString(messageName, "CallDidSetPartitionOrBlockCookiesForHost")) {
-        m_testRunner->statisticsCallDidSetPartitionOrBlockCookiesForHostCallback();
-        return;
-    }
-
     if (WKStringIsEqualToUTF8CString(messageName, "CallDidRemoveAllSessionCredentialsCallback")) {
         m_testRunner->callDidRemoveAllSessionCredentialsCallback();
         return;
index 270d638..6476adf 100644 (file)
@@ -651,7 +651,6 @@ enum {
     StatisticsDidScanDataRecordsCallbackID,
     StatisticsDidRunTelemetryCallbackID,
     StatisticsDidClearThroughWebsiteDataRemovalCallbackID,
-    StatisticsDidSetPartitionOrBlockCookiesForHostCallbackID,
     DidRemoveAllSessionCredentialsCallbackID,
     GetApplicationManifestCallbackID,
     FirstUIScriptCallbackID = 100
@@ -1554,18 +1553,14 @@ void TestRunner::statisticsProcessStatisticsAndDataRecords()
     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
 }
 
-void TestRunner::statisticsUpdateCookiePartitioning(JSValueRef callback)
+void TestRunner::statisticsUpdateCookiePartitioning()
 {
-    cacheTestRunnerCallback(StatisticsDidSetPartitionOrBlockCookiesForHostCallbackID, callback);
-
     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsUpdateCookiePartitioning"));
     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
 }
 
-void TestRunner::statisticsSetShouldPartitionCookiesForHost(JSStringRef hostName, bool value, JSValueRef callback)
+void TestRunner::statisticsSetShouldPartitionCookiesForHost(JSStringRef hostName, bool value)
 {
-    cacheTestRunnerCallback(StatisticsDidSetPartitionOrBlockCookiesForHostCallbackID, callback);
-
     Vector<WKRetainPtr<WKStringRef>> keys;
     Vector<WKRetainPtr<WKTypeRef>> values;
     
@@ -1589,11 +1584,6 @@ void TestRunner::statisticsSetShouldPartitionCookiesForHost(JSStringRef hostName
     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
 }
 
-void TestRunner::statisticsCallDidSetPartitionOrBlockCookiesForHostCallback()
-{
-    callTestRunnerCallback(StatisticsDidSetPartitionOrBlockCookiesForHostCallbackID);
-}
-
 void TestRunner::statisticsSubmitTelemetry()
 {
     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry"));
index cc60415..39077f7 100644 (file)
@@ -367,9 +367,8 @@ public:
     void statisticsDidRunTelemetryCallback(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins);
     void statisticsNotifyObserver();
     void statisticsProcessStatisticsAndDataRecords();
-    void statisticsUpdateCookiePartitioning(JSValueRef callback);
-    void statisticsSetShouldPartitionCookiesForHost(JSStringRef hostName, bool value, JSValueRef callback);
-    void statisticsCallDidSetPartitionOrBlockCookiesForHostCallback();
+    void statisticsUpdateCookiePartitioning();
+    void statisticsSetShouldPartitionCookiesForHost(JSStringRef hostName, bool value);
     void statisticsSubmitTelemetry();
     void setStatisticsLastSeen(JSStringRef hostName, double seconds);
     void setStatisticsPrevalentResource(JSStringRef hostName, bool value);
index 987ade4..f5466d8 100644 (file)
@@ -1345,12 +1345,6 @@ void TestInvocation::didClearStatisticsThroughWebsiteDataRemoval()
     WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0);
 }
 
-void TestInvocation::didSetPartitionOrBlockCookiesForHost()
-{
-    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidSetPartitionOrBlockCookiesForHost"));
-    WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0);
-}
-
 void TestInvocation::didRemoveAllSessionCredentials()
 {
     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidRemoveAllSessionCredentialsCallback"));
index 25ce67d..42cf965 100644 (file)
@@ -72,7 +72,6 @@ public:
     void notifyDownloadDone();
 
     void didClearStatisticsThroughWebsiteDataRemoval();
-    void didSetPartitionOrBlockCookiesForHost();
 
     void didRemoveAllSessionCredentials();
     
index 9c19763..f98329b 100644 (file)
@@ -376,16 +376,12 @@ void TestController::statisticsProcessStatisticsAndDataRecords()
 
 void TestController::statisticsUpdateCookiePartitioning()
 {
-    [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:^() {
-        m_currentInvocation->didSetPartitionOrBlockCookiesForHost();
-    }];
+    [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning];
 }
 
 void TestController::statisticsSetShouldPartitionCookiesForHost(WKStringRef hostName, bool value)
 {
-    [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:value forHost:toNSString(hostName) completionHandler:^() {
-        m_currentInvocation->didSetPartitionOrBlockCookiesForHost();
-    }];
+    [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:value forHost:toNSString(hostName)];
 }
 
 void TestController::statisticsSubmitTelemetry()