Title: [287013] trunk
Revision
287013
Author
[email protected]
Date
2021-12-13 23:56:44 -0800 (Mon, 13 Dec 2021)

Log Message

PCM: Remove old DB update and migration code, and add a unit test for destination token DB columns
https://bugs.webkit.org/show_bug.cgi?id=234281
<rdar://86347439>

Reviewed by Alex Christensen and Kate Cheney.

Source/WebKit:

WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp has a comment saying it
should be removed late 2021. WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary()
returns directly if WebKit::Database::needsUpdatedSchema() returns false so always returning
false for WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp effectively
disables WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary() for PCM.

New unit/API test PrivateClickMeasurement.MigrateWithDestinationToken added.

* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
(WebKit::PCM::Database::Database):
    No longer calls the deleted DatabaseUtilities::migrateDataToNewTablesIfNecessary().
(WebKit::PCM::Database::attributionToStringForTesting const):
    Now outputs destination token info.
(WebKit::PCM::Database::needsUpdatedSchema): Deleted.
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
    needsUpdatedSchema() now always returns false.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm:
(addAttributedPCMv5):
(pollUntilPCMIsMigrated):
    Now takes a parameter UsingDestinationToken and handles its expectation
    accordingly.
(TEST):
    New test PrivateClickMeasurement.MigrateWithDestinationToken.

LayoutTests:

These expect files are just updated with destination token dump output.

* http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-ephemeral-expected.txt:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window-expected.txt:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority-expected.txt:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority-expected.txt:
* http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority-expected.txt:
* http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority-expected.txt:
* http/tests/privateClickMeasurement/second-conversion-with-higher-priority-expected.txt:
* http/tests/privateClickMeasurement/second-conversion-with-lower-priority-expected.txt:
* http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287012 => 287013)


--- trunk/LayoutTests/ChangeLog	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/ChangeLog	2021-12-14 07:56:44 UTC (rev 287013)
@@ -1,3 +1,24 @@
+2021-12-13  John Wilander  <[email protected]>
+
+        PCM: Remove old DB update and migration code, and add a unit test for destination token DB columns
+        https://bugs.webkit.org/show_bug.cgi?id=234281
+        <rdar://86347439>
+
+        Reviewed by Alex Christensen and Kate Cheney.
+
+        These expect files are just updated with destination token dump output.
+
+        * http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-ephemeral-expected.txt:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window-expected.txt:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority-expected.txt:
+        * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority-expected.txt:
+        * http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority-expected.txt:
+        * http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority-expected.txt:
+        * http/tests/privateClickMeasurement/second-conversion-with-higher-priority-expected.txt:
+        * http/tests/privateClickMeasurement/second-conversion-with-lower-priority-expected.txt:
+        * http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-expected.txt:
+
 2021-12-13  Alex Christensen  <[email protected]>
 
         Allow WKContentRuleList to run regexes on current frame's URL, not just top frame's URL

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -12,4 +12,5 @@
 Attribution trigger data: 12
 Attribution priority: 0
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-ephemeral-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-ephemeral-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-ephemeral-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 0
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 3
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 3
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 0
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 4
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 4
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 4
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -9,4 +9,5 @@
 Attribution trigger data: 12
 Attribution priority: 4
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: com.apple.WebKit.WebKitTestRunner

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-expected.txt (287012 => 287013)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-expected.txt	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-expected.txt	2021-12-14 07:56:44 UTC (rev 287013)
@@ -12,4 +12,5 @@
 Attribution trigger data: 12
 Attribution priority: 0
 Attribution earliest time to send: Within 24-48 hours
+Destination token: Not set
 Application bundle identifier: testBundleID

Modified: trunk/Source/WebKit/ChangeLog (287012 => 287013)


--- trunk/Source/WebKit/ChangeLog	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/Source/WebKit/ChangeLog	2021-12-14 07:56:44 UTC (rev 287013)
@@ -1,3 +1,28 @@
+2021-12-13  John Wilander  <[email protected]>
+
+        PCM: Remove old DB update and migration code, and add a unit test for destination token DB columns
+        https://bugs.webkit.org/show_bug.cgi?id=234281
+        <rdar://86347439>
+
+        Reviewed by Alex Christensen and Kate Cheney.
+
+        WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp has a comment saying it
+        should be removed late 2021. WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary()
+        returns directly if WebKit::Database::needsUpdatedSchema() returns false so always returning
+        false for WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp effectively
+        disables WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary() for PCM.
+
+        New unit/API test PrivateClickMeasurement.MigrateWithDestinationToken added.
+
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
+        (WebKit::PCM::Database::Database):
+            No longer calls the deleted DatabaseUtilities::migrateDataToNewTablesIfNecessary().
+        (WebKit::PCM::Database::attributionToStringForTesting const):
+            Now outputs destination token info.
+        (WebKit::PCM::Database::needsUpdatedSchema): Deleted.
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
+            needsUpdatedSchema() now always returns false.
+
 2021-12-13  Alex Christensen  <[email protected]>
 
         Allow WKContentRuleList to run regexes on current frame's URL, not just top frame's URL

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp (287012 => 287013)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp	2021-12-14 07:56:44 UTC (rev 287013)
@@ -88,7 +88,6 @@
     openDatabaseAndCreateSchemaIfNecessary();
     enableForeignKeys();
     addDestinationTokenColumnsIfNecessary();
-    migrateDataToNewTablesIfNecessary();
     allDatabases().add(this);
 }
 
@@ -449,6 +448,12 @@
             auto secondsUntilSend = *earliestTimeToSend - WallTime::now();
             builder.append((secondsUntilSend >= 24_h && secondsUntilSend <= 48_h) ? "Within 24-48 hours" : "Outside 24-48 hours");
         }
+
+        builder.append("\nDestination token: ");
+        if (!triggerData->destinationSecretToken)
+            builder.append("Not set");
+        else
+            builder.append("\ntoken: ", triggerData->destinationSecretToken->tokenBase64URL, "\nsignature: ", triggerData->destinationSecretToken->signatureBase64URL, "\nkey: ", triggerData->destinationSecretToken->keyIDBase64URL);
     } else
         builder.append("\nNo attribution trigger data.");
     builder.append("\nApplication bundle identifier: ", pcm.sourceApplicationBundleID(), '\n');
@@ -716,17 +721,6 @@
     }
 }
 
-bool Database::needsUpdatedSchema()
-{
-    // FIXME: Remove this at the end of 2021. No public release was made with the schema missing sourceApplicationBundleID, so this is only needed to migrate internal users who updated in September 2021.
-    for (auto& table : expectedTableAndIndexQueries().keys()) {
-        if (currentTableAndIndexQueries(table) != expectedTableAndIndexQueries().get(table))
-            return true;
-    }
-
-    return false;
-}
-
 Vector<String> Database::columnsForTable(const String& tableName)
 {
     auto statement = m_database.prepareStatementSlow(makeString("PRAGMA table_info(", tableName, ")"));

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h (287012 => 287013)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h	2021-12-14 07:56:44 UTC (rev 287013)
@@ -77,7 +77,7 @@
     String getDomainStringFromDomainID(DomainID) const final;
 
     void addDestinationTokenColumnsIfNecessary();
-    bool needsUpdatedSchema() final;
+    bool needsUpdatedSchema() final { return false; };
     bool createUniqueIndices() final;
     const MemoryCompactLookupOnlyRobinHoodHashMap<String, TableAndIndexPair>& expectedTableAndIndexQueries() final;
     Span<const ASCIILiteral> sortedTables() final;

Modified: trunk/Tools/ChangeLog (287012 => 287013)


--- trunk/Tools/ChangeLog	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/Tools/ChangeLog	2021-12-14 07:56:44 UTC (rev 287013)
@@ -1,3 +1,19 @@
+2021-12-13  John Wilander  <[email protected]>
+
+        PCM: Remove old DB update and migration code, and add a unit test for destination token DB columns
+        https://bugs.webkit.org/show_bug.cgi?id=234281
+        <rdar://86347439>
+
+        Reviewed by Alex Christensen and Kate Cheney.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm:
+        (addAttributedPCMv5):
+        (pollUntilPCMIsMigrated):
+            Now takes a parameter UsingDestinationToken and handles its expectation
+            accordingly.
+        (TEST):
+            New test PrivateClickMeasurement.MigrateWithDestinationToken.
+
 2021-12-13  Alex Christensen  <[email protected]>
 
         Allow WKContentRuleList to run regexes on current frame's URL, not just top frame's URL

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm (287012 => 287013)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm	2021-12-14 07:07:39 UTC (rev 287012)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm	2021-12-14 07:56:44 UTC (rev 287013)
@@ -209,6 +209,27 @@
     addValuesToTable<12>(database, insertAttributedPrivateClickMeasurementQueryV4, { 1, 2, 42, 14, 7, 1.0, earliestTimeToSend(), "test token", "test signature", "test key id", earliestTimeToSend(), bundleID });
 }
 
+static void addAttributedPCMv5(WebCore::SQLiteDatabase& database)
+{
+    constexpr auto createAttributedPrivateClickMeasurementV5 = "CREATE TABLE AttributedPrivateClickMeasurement ("
+        "sourceSiteDomainID INTEGER NOT NULL, destinationSiteDomainID INTEGER NOT NULL, sourceID INTEGER NOT NULL, "
+        "attributionTriggerData INTEGER NOT NULL, priority INTEGER NOT NULL, timeOfAdClick REAL NOT NULL, "
+        "earliestTimeToSendToSource REAL, token TEXT, signature TEXT, keyID TEXT, earliestTimeToSendToDestination REAL, sourceApplicationBundleID TEXT, destinationToken, destinationSignature, destinationKeyID,"
+        "FOREIGN KEY(sourceSiteDomainID) REFERENCES PCMObservedDomains(domainID) ON DELETE CASCADE, FOREIGN KEY(destinationSiteDomainID) REFERENCES "
+        "PCMObservedDomains(domainID) ON DELETE CASCADE)"_s;
+
+    EXPECT_TRUE(database.executeCommand(createAttributedPrivateClickMeasurementV5));
+    constexpr auto insertAttributedPrivateClickMeasurementQueryV5 = "INSERT OR REPLACE INTO AttributedPrivateClickMeasurement (sourceSiteDomainID, destinationSiteDomainID, "
+        "sourceID, attributionTriggerData, priority, timeOfAdClick, earliestTimeToSendToSource, token, signature, keyID, earliestTimeToSendToDestination, sourceApplicationBundleID, destinationToken, destinationSignature, destinationKeyID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"_s;
+
+#if PLATFORM(MAC)
+    auto bundleID = "com.apple.Safari";
+#else
+    auto bundleID = "com.apple.mobilesafari";
+#endif
+    addValuesToTable<15>(database, insertAttributedPrivateClickMeasurementQueryV5, { 1, 2, 42, 14, 7, 1.0, earliestTimeToSend(), "test token", "test signature", "test key id", earliestTimeToSend(), bundleID, "test destination token", "test destination signature", "test destination key id" });
+}
+
 static RetainPtr<NSString> dumpedPCM(WKWebView *webView)
 {
     __block RetainPtr<NSString> pcm;
@@ -222,7 +243,8 @@
 }
 
 enum class MigratingFromResourceLoadStatistics : bool { No, Yes };
-static void pollUntilPCMIsMigrated(WKWebView *webView, MigratingFromResourceLoadStatistics migratingFromResourceLoadStatistics)
+enum class UsingDestinationToken : bool { No, Yes };
+static void pollUntilPCMIsMigrated(WKWebView *webView, MigratingFromResourceLoadStatistics migratingFromResourceLoadStatistics, UsingDestinationToken usingDestinationToken)
 {
     if (migratingFromResourceLoadStatistics == MigratingFromResourceLoadStatistics::Yes) {
         // This query is the first thing to open the old database, so migration has not happened yet.
@@ -251,15 +273,20 @@
         "Attribution trigger data: 14\n"
         "Attribution priority: 7\n"
         "Attribution earliest time to send: Outside 24-48 hours\n"
+        "";
+
+    NSString *suffix = @"Destination token: ";
+    suffix = [suffix stringByAppendingString:(usingDestinationToken == UsingDestinationToken::No ? @"Not set\n" : @"\ntoken: test destination token\nsignature: test destination signature\nkey: test destination key id\n")];
 #if PLATFORM(MAC)
-        "Application bundle identifier: com.apple.Safari\n"
+    suffix = [suffix stringByAppendingString:@"Application bundle identifier: com.apple.Safari\n"];
 #else
-        "Application bundle identifier: com.apple.mobilesafari\n"
+    suffix = [suffix stringByAppendingString:@"Application bundle identifier: com.apple.mobilesafari\n"];
 #endif
-        "";
+    expectedMigratedPCMDatabase = [expectedMigratedPCMDatabase stringByAppendingString:suffix];
 
     while (![dumpedPCM(webView) isEqualToString:expectedMigratedPCMDatabase])
         usleep(10000);
+    EXPECT_WK_STREQ(dumpedPCM(webView).get(), expectedMigratedPCMDatabase);
 }
 
 static NSString *emptyObservationsDBPath()
@@ -354,7 +381,7 @@
 {
     setUpFromResourceLoadStatisticsDatabase(addUnattributedPCMv1, addAttributedPCMv1);
     auto webView = webViewWithResourceLoadStatisticsEnabledInNetworkProcess();
-    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes);
+    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes, UsingDestinationToken::No);
     cleanUp();
 }
 
@@ -362,7 +389,7 @@
 {
     setUpFromResourceLoadStatisticsDatabase(addUnattributedPCMv2, addAttributedPCMv2);
     auto webView = webViewWithResourceLoadStatisticsEnabledInNetworkProcess();
-    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes);
+    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes, UsingDestinationToken::No);
     cleanUp();
 }
 
@@ -370,7 +397,7 @@
 {
     setUpFromResourceLoadStatisticsDatabase(addUnattributedPCMv3, addAttributedPCMv3);
     auto webView = webViewWithResourceLoadStatisticsEnabledInNetworkProcess();
-    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes);
+    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::Yes, UsingDestinationToken::No);
     cleanUp();
 }
 
@@ -378,6 +405,14 @@
 {
     setUpFromPCMDatabase(addUnattributedPCMv4, addAttributedPCMv4);
     auto webView = webViewWithResourceLoadStatisticsEnabledInNetworkProcess();
-    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::No);
+    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::No, UsingDestinationToken::No);
     cleanUp();
 }
+
+TEST(PrivateClickMeasurement, MigrateWithDestinationToken)
+{
+    setUpFromPCMDatabase(addUnattributedPCMv4, addAttributedPCMv5);
+    auto webView = webViewWithResourceLoadStatisticsEnabledInNetworkProcess();
+    pollUntilPCMIsMigrated(webView.get(), MigratingFromResourceLoadStatistics::No, UsingDestinationToken::Yes);
+    cleanUp();
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to