Diff
Modified: trunk/LayoutTests/ChangeLog (274512 => 274513)
--- trunk/LayoutTests/ChangeLog 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/ChangeLog 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1,3 +1,30 @@
+2021-03-16 John Wilander <[email protected]>
+
+ PCM: Test infrastructure for sending attribution reports to attribution website too
+ https://bugs.webkit.org/show_bug.cgi?id=223238
+ <rdar://problem/75462031>
+
+ Reviewed by Brent Fulgham.
+
+ setPrivateClickMeasurementAttributionReportURLForTesting() now is named
+ setPrivateClickMeasurementAttributionReportURLsForTesting() in the layers that
+ eventually reach WebKit::PrivateClickMeasurementManager. It takes two URLs
+ attributionReportSourceURL and attributionReportAttributeOnURL and sets them
+ in a new struct AttributionReportTestConfig.
+
+ * http/tests/contentextensions/block-private-click-measurement.html:
+ * http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html:
+ * http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html:
+ * http/tests/privateClickMeasurement/resources/getConversionData.php:
+ * http/tests/privateClickMeasurement/resources/util.js:
+ (tearDownAndFinish):
+ * http/tests/privateClickMeasurement/send-attribution-conversion-request.html:
+ * http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html:
+ * platform/mac-wk2/TestExpectations:
+ This was marked as an old flaky failure and tracked in rdar://63357481.
+ I've kept my eye on it and it does not seem flaky anymore. Removed failure
+ expectation to get better test coverage.
+
2021-03-16 Truitt Savell <[email protected]>
Many media/media-fragments/ tests are crashing due to other tests that run before them.
Modified: trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html (274512 => 274513)
--- trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html 2021-03-16 20:57:04 UTC (rev 274513)
@@ -15,7 +15,7 @@
if (window.testRunner) {
testRunner.setPrivateClickMeasurementOverrideTimerForTesting(true);
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php");
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php", "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php");
}
function activateElement(elementID) {
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html 2021-03-16 20:57:04 UTC (rev 274513)
@@ -18,7 +18,7 @@
prepareTest();
if (window.testRunner)
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
function activateElement(elementID) {
var element = document.getElementById(elementID);
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html 2021-03-16 20:57:04 UTC (rev 274513)
@@ -18,7 +18,7 @@
prepareTest();
if (window.testRunner) {
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
}
function activateElement(elementID) {
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getConversionData.php 2021-03-16 20:57:04 UTC (rev 274513)
@@ -45,7 +45,7 @@
echo "if (window.testRunner) {";
echo " testRunner.notifyDone();";
echo " testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);";
- echo " testRunner.setPrivateClickMeasurementAttributionReportURLForTesting('');";
+ echo " testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting('', '');";
echo "}";
echo "</script>";
}
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/util.js (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/util.js 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/util.js 2021-03-16 20:57:04 UTC (rev 274513)
@@ -11,7 +11,7 @@
if (window.testRunner) {
testRunner.setAllowsAnySSLCertificate(false);
testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("");
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("", "");
testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("");
testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting("");
testRunner.notifyDone();
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html 2021-03-16 20:57:04 UTC (rev 274513)
@@ -59,7 +59,7 @@
function runTest() {
if (window.testRunner) {
if (window.location.search === "?stepTwo") {
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce, "http://localhost:8000/privateClickMeasurement/resources/conversionReport.php?nonce=" + nonce);
let imageElement = document.createElement("img");
imageElement.src = "" + nonce;
imageElement.id = "pixel";
Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html (274512 => 274513)
--- trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html 2021-03-16 20:57:04 UTC (rev 274513)
@@ -53,7 +53,7 @@
if (!window.location.search) {
testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy);
testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy);
- testRunner.setPrivateClickMeasurementAttributionReportURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy + "&last=true");
+ testRunner.setPrivateClickMeasurementAttributionReportURLsForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy + "&last=true", "http://localhost:8000/privateClickMeasurement/resources/fraudPreventionTestURL.php?dummy=" + dummy + "&last=true");
testRunner.setPrivateClickMeasurementOverrideTimerForTesting(true);
testRunner.setPrivateClickMeasurementFraudPreventionValuesForTesting("unlinkableToken", "secretToken", "signature", "WF3Ugg");
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (274512 => 274513)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1115,9 +1115,6 @@
# <rdar://problem/63275213> REGRESSION: http/tests/IndexedDB/storage-limit-1.https.html is a flaky failure
[ BigSur+ Release ] http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]
-# <rdar://problem/63357481> http/tests/privateClickMeasurement/send-attribution-conversion-request.html is a super flaky failure
-[ BigSur+ Debug ] http/tests/privateClickMeasurement/send-attribution-conversion-request.html [ Pass Failure ]
-
# <rdar://problem/63554249> [20A279] DQ bots are seeing http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html and http/tests/cache/disk-cache/disk-cache-validation-no-body.html are timing out
webkit.org/b/179796 http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html [ Pass Failure Timeout ]
[ BigSur+ Release ] http/tests/cache/disk-cache/disk-cache-validation-no-body.html [ Pass Timeout ]
Modified: trunk/Source/WebKit/ChangeLog (274512 => 274513)
--- trunk/Source/WebKit/ChangeLog 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/ChangeLog 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1,3 +1,46 @@
+2021-03-16 John Wilander <[email protected]>
+
+ PCM: Test infrastructure for sending attribution reports to attribution website too
+ https://bugs.webkit.org/show_bug.cgi?id=223238
+ <rdar://problem/75462031>
+
+ Reviewed by Brent Fulgham.
+
+ setPrivateClickMeasurementAttributionReportURLForTesting() now is named
+ setPrivateClickMeasurementAttributionReportURLsForTesting() in the layers that
+ eventually reach WebKit::PrivateClickMeasurementManager. It takes two URLs
+ attributionReportSourceURL and attributionReportAttributeOnURL and sets them
+ in a new struct AttributionReportTestConfig.
+
+ No new tests. This patch just adds test infrastructure for a coming patch.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::setPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WebKit::NetworkProcess::setPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkProcess.messages.in:
+ * NetworkProcess/NetworkSession.cpp:
+ (WebKit::NetworkSession::setPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WebKit::NetworkSession::setPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * NetworkProcess/NetworkSession.h:
+ * NetworkProcess/PrivateClickMeasurementManager.cpp:
+ (WebKit::PrivateClickMeasurementManager::fireConversionRequestImpl):
+ (WebKit::PrivateClickMeasurementManager::setAttributionReportURLsForTesting):
+ (WebKit::PrivateClickMeasurementManager::setAttributionReportURLForTesting): Deleted.
+ * NetworkProcess/PrivateClickMeasurementManager.h:
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageSetPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WKPageSetPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * UIProcess/API/C/WKPagePrivate.h:
+ * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
+ * UIProcess/API/Cocoa/WKWebViewTesting.mm:
+ (-[WKWebView _setPrivateClickMeasurementAttributionReportURLsForTesting:attributeOnURL:completionHandler:]):
+ (-[WKWebView _setPrivateClickMeasurementAttributionReportURLForTesting:completionHandler:]): Deleted.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WebKit::WebPageProxy::setPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * UIProcess/WebPageProxy.h:
+
2021-03-16 Per Arne Vollan <[email protected]>
The WebContent process crashes when launching Safari
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -2649,11 +2649,11 @@
completionHandler();
}
-void NetworkProcess::setPrivateClickMeasurementAttributionReportURLForTesting(PAL::SessionID sessionID, URL&& url, CompletionHandler<void()>&& completionHandler)
+void NetworkProcess::setPrivateClickMeasurementAttributionReportURLsForTesting(PAL::SessionID sessionID, URL&& sourceURL, URL&& attributeOnURL, CompletionHandler<void()>&& completionHandler)
{
if (auto* session = networkSession(sessionID))
- session->setPrivateClickMeasurementAttributionReportURLForTesting(WTFMove(url));
-
+ session->setPrivateClickMeasurementAttributionReportURLsForTesting(WTFMove(sourceURL), WTFMove(attributeOnURL));
+
completionHandler();
}
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -341,7 +341,7 @@
void simulateResourceLoadStatisticsSessionRestart(PAL::SessionID, CompletionHandler<void()>&&);
void setPrivateClickMeasurementTokenPublicKeyURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&);
void setPrivateClickMeasurementTokenSignatureURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&);
- void setPrivateClickMeasurementAttributionReportURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&);
+ void setPrivateClickMeasurementAttributionReportURLsForTesting(PAL::SessionID, URL&& sourceURL, URL&& attributeOnURL, CompletionHandler<void()>&&);
void markPrivateClickMeasurementsAsExpiredForTesting(PAL::SessionID, CompletionHandler<void()>&&);
void setPCMFraudPreventionValuesForTesting(PAL::SessionID, String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID, CompletionHandler<void()>&&);
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-03-16 20:57:04 UTC (rev 274513)
@@ -169,7 +169,7 @@
SimulateResourceLoadStatisticsSessionRestart(PAL::SessionID sessionID) -> () Async
SetPrivateClickMeasurementTokenPublicKeyURLForTesting(PAL::SessionID sessionID, URL url) -> () Async
SetPrivateClickMeasurementTokenSignatureURLForTesting(PAL::SessionID sessionID, URL url) -> () Async
- SetPrivateClickMeasurementAttributionReportURLForTesting(PAL::SessionID sessionID, URL url) -> () Async
+ SetPrivateClickMeasurementAttributionReportURLsForTesting(PAL::SessionID sessionID, URL sourceURL, URL attributeOnURL) -> () Async
MarkPrivateClickMeasurementsAsExpiredForTesting(PAL::SessionID sessionID) -> () Async
SetPCMFraudPreventionValuesForTesting(PAL::SessionID sessionID, String secretToken, String unlinkableToken, String signature, String keyID) -> () Async
GetLocalStorageOriginDetails(PAL::SessionID sessionID) -> (Vector<WebKit::LocalStorageDatabaseTracker::OriginDetails> details) Async
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -348,9 +348,9 @@
privateClickMeasurement().setTokenSignatureURLForTesting(WTFMove(url));
}
-void NetworkSession::setPrivateClickMeasurementAttributionReportURLForTesting(URL&& url)
+void NetworkSession::setPrivateClickMeasurementAttributionReportURLsForTesting(URL&& sourceURL, URL&& attributeOnURL)
{
- privateClickMeasurement().setAttributionReportURLForTesting(WTFMove(url));
+ privateClickMeasurement().setAttributionReportURLsForTesting(WTFMove(sourceURL), WTFMove(attributeOnURL));
}
void NetworkSession::markPrivateClickMeasurementsAsExpiredForTesting()
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -126,7 +126,7 @@
void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&);
void setPrivateClickMeasurementTokenPublicKeyURLForTesting(URL&&);
void setPrivateClickMeasurementTokenSignatureURLForTesting(URL&&);
- void setPrivateClickMeasurementAttributionReportURLForTesting(URL&&);
+ void setPrivateClickMeasurementAttributionReportURLsForTesting(URL&& sourceURL, URL&& attributeOnURL);
void markPrivateClickMeasurementsAsExpiredForTesting();
void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID);
void firePrivateClickMeasurementTimerImmediately();
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -324,7 +324,7 @@
void PrivateClickMeasurementManager::fireConversionRequestImpl(const PrivateClickMeasurement& attribution)
{
- auto attributionURL = m_attributionReportBaseURLForTesting ? *m_attributionReportBaseURLForTesting : attribution.attributionReportSourceURL();
+ auto attributionURL = m_attributionReportTestConfig ? m_attributionReportTestConfig->attributionReportSourceURL : attribution.attributionReportSourceURL();
if (attributionURL.isEmpty() || !attributionURL.isValid())
return;
@@ -474,12 +474,12 @@
m_tokenSignatureURLForTesting = WTFMove(testURL);
}
-void PrivateClickMeasurementManager::setAttributionReportURLForTesting(URL&& testURL)
+void PrivateClickMeasurementManager::setAttributionReportURLsForTesting(URL&& sourceURL, URL&& attributeOnURL)
{
- if (testURL.isEmpty())
- m_attributionReportBaseURLForTesting = { };
+ if (sourceURL.isEmpty() || attributeOnURL.isEmpty())
+ m_attributionReportTestConfig = WTF::nullopt;
else
- m_attributionReportBaseURLForTesting = WTFMove(testURL);
+ m_attributionReportTestConfig = AttributionReportTestConfig { WTFMove(sourceURL), WTFMove(attributeOnURL) };
}
void PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting()
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h (274512 => 274513)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -63,7 +63,7 @@
void setOverrideTimerForTesting(bool value) { m_isRunningTest = value; }
void setTokenPublicKeyURLForTesting(URL&&);
void setTokenSignatureURLForTesting(URL&&);
- void setAttributionReportURLForTesting(URL&&);
+ void setAttributionReportURLsForTesting(URL&& sourceURL, URL&& attributeOnURL);
void markAllUnattributedAsExpiredForTesting();
void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&);
void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID);
@@ -85,12 +85,18 @@
bool m_isRunningTest { false };
Optional<URL> m_tokenPublicKeyURLForTesting;
Optional<URL> m_tokenSignatureURLForTesting;
- Optional<URL> m_attributionReportBaseURLForTesting;
WeakPtr<NetworkSession> m_networkSession;
Ref<NetworkProcess> m_networkProcess;
PAL::SessionID m_sessionID;
Function<void(NetworkResourceLoadParameters&&, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&&)> m_pingLoadFunction;
+ struct AttributionReportTestConfig {
+ URL attributionReportSourceURL;
+ URL attributionReportAttributeOnURL;
+ };
+
+ Optional<AttributionReportTestConfig> m_attributionReportTestConfig;
+
struct TestingFraudPreventionValues {
String unlinkableToken;
String secretToken;
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -2959,9 +2959,9 @@
});
}
-void WKPageSetPrivateClickMeasurementAttributionReportURLForTesting(WKPageRef page, WKURLRef URLRef, WKPageSetPrivateClickMeasurementAttributionReportURLForTestingFunction callback, void* callbackContext)
+void WKPageSetPrivateClickMeasurementAttributionReportURLsForTesting(WKPageRef page, WKURLRef sourceURL, WKURLRef attributeOnURL, WKPageSetPrivateClickMeasurementAttributionReportURLsForTestingFunction callback, void* callbackContext)
{
- toImpl(page)->setPrivateClickMeasurementAttributionReportURLForTesting(URL(URL(), toWTFString(URLRef)), [callbackContext, callback] () {
+ toImpl(page)->setPrivateClickMeasurementAttributionReportURLsForTesting(URL(URL(), toWTFString(sourceURL)), URL(URL(), toWTFString(attributeOnURL)), [callbackContext, callback] () {
callback(callbackContext);
});
}
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPagePrivate.h (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/API/C/WKPagePrivate.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPagePrivate.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -183,8 +183,8 @@
WK_EXPORT void WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting(WKPageRef page, WKURLRef urlString, WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTestingFunction callback, void* callbackContext);
typedef void (*WKPageSetPrivateClickMeasurementTokenSignatureURLForTestingFunction)(void* functionContext);
WK_EXPORT void WKPageSetPrivateClickMeasurementTokenSignatureURLForTesting(WKPageRef page, WKURLRef urlString, WKPageSetPrivateClickMeasurementTokenSignatureURLForTestingFunction callback, void* callbackContext);
-typedef void (*WKPageSetPrivateClickMeasurementAttributionReportURLForTestingFunction)(void* functionContext);
-WK_EXPORT void WKPageSetPrivateClickMeasurementAttributionReportURLForTesting(WKPageRef page, WKURLRef urlString, WKPageSetPrivateClickMeasurementAttributionReportURLForTestingFunction callback, void* callbackContext);
+typedef void (*WKPageSetPrivateClickMeasurementAttributionReportURLsForTestingFunction)(void* functionContext);
+WK_EXPORT void WKPageSetPrivateClickMeasurementAttributionReportURLsForTesting(WKPageRef page, WKURLRef sourceURL, WKURLRef attributeOnURL, WKPageSetPrivateClickMeasurementAttributionReportURLsForTestingFunction callback, void* callbackContext);
typedef void (*WKPageMarkPrivateClickMeasurementsAsExpiredForTestingFunction)(void* functionContext);
WK_EXPORT void WKPageMarkPrivateClickMeasurementsAsExpiredForTesting(WKPageRef page, WKPageMarkPrivateClickMeasurementsAsExpiredForTestingFunction callback, void* callbackContext);
typedef void (*WKPageSetPCMFraudPreventionValuesForTestingFunction)(void* functionContext);
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -90,7 +90,7 @@
- (NSNumber *)_suspendMediaPlaybackCounter WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
- (void)_setPrivateClickMeasurementOverrideTimerForTesting:(BOOL)overrideTimer completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
-- (void)_setPrivateClickMeasurementAttributionReportURLForTesting:(NSURL *)url completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_setPrivateClickMeasurementAttributionReportURLsForTesting:(NSURL *)sourceURL attributeOnURL:(NSURL *)attributeOnURL completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
- (void)_lastNavigationWasAppBound:(void(^)(BOOL))completionHandler;
- (void)_appBoundNavigationData:(void(^)(struct WKAppBoundNavigationTestingData data))completionHandler;
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2021-03-16 20:57:04 UTC (rev 274513)
@@ -302,9 +302,9 @@
});
}
-- (void)_setPrivateClickMeasurementAttributionReportURLForTesting:(NSURL *)url completionHandler:(void(^)(void))completionHandler
+- (void)_setPrivateClickMeasurementAttributionReportURLsForTesting:(NSURL *)sourceURL attributeOnURL:(NSURL *)attributeOnURL completionHandler:(void(^)(void))completionHandler
{
- _page->setPrivateClickMeasurementAttributionReportURLForTesting(url, [completionHandler = makeBlockPtr(completionHandler)] {
+ _page->setPrivateClickMeasurementAttributionReportURLsForTesting(sourceURL, attributeOnURL, [completionHandler = makeBlockPtr(completionHandler)] {
completionHandler();
});
}
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -10015,9 +10015,9 @@
websiteDataStore().networkProcess().sendWithAsyncReply(Messages::NetworkProcess::SetPrivateClickMeasurementTokenSignatureURLForTesting(m_websiteDataStore->sessionID(), url), WTFMove(completionHandler));
}
-void WebPageProxy::setPrivateClickMeasurementAttributionReportURLForTesting(const URL& url, CompletionHandler<void()>&& completionHandler)
+void WebPageProxy::setPrivateClickMeasurementAttributionReportURLsForTesting(const URL& sourceURL, const URL& attributeOnURL, CompletionHandler<void()>&& completionHandler)
{
- websiteDataStore().networkProcess().sendWithAsyncReply(Messages::NetworkProcess::SetPrivateClickMeasurementAttributionReportURLForTesting(m_websiteDataStore->sessionID(), url), WTFMove(completionHandler));
+ websiteDataStore().networkProcess().sendWithAsyncReply(Messages::NetworkProcess::SetPrivateClickMeasurementAttributionReportURLsForTesting(m_websiteDataStore->sessionID(), sourceURL, attributeOnURL), WTFMove(completionHandler));
}
void WebPageProxy::markPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&& completionHandler)
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (274512 => 274513)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1706,7 +1706,7 @@
void simulateResourceLoadStatisticsSessionRestart(CompletionHandler<void()>&&);
void setPrivateClickMeasurementTokenPublicKeyURLForTesting(const URL&, CompletionHandler<void()>&&);
void setPrivateClickMeasurementTokenSignatureURLForTesting(const URL&, CompletionHandler<void()>&&);
- void setPrivateClickMeasurementAttributionReportURLForTesting(const URL&, CompletionHandler<void()>&&);
+ void setPrivateClickMeasurementAttributionReportURLsForTesting(const URL& sourceURL, const URL& attributeOnURL, CompletionHandler<void()>&&);
void markPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&);
void setPCMFraudPreventionValuesForTesting(const String& unlinkableToken, const String& secretToken, const String& signature, const String& keyID, CompletionHandler<void()>&&);
Modified: trunk/Tools/ChangeLog (274512 => 274513)
--- trunk/Tools/ChangeLog 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/ChangeLog 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1,3 +1,31 @@
+2021-03-16 John Wilander <[email protected]>
+
+ PCM: Test infrastructure for sending attribution reports to attribution website too
+ https://bugs.webkit.org/show_bug.cgi?id=223238
+ <rdar://problem/75462031>
+
+ Reviewed by Brent Fulgham.
+
+ setPrivateClickMeasurementAttributionReportURLForTesting() now is named
+ setPrivateClickMeasurementAttributionReportURLsForTesting() in the layers that
+ eventually reach WebKit::PrivateClickMeasurementManager. It takes two URLs
+ attributionReportSourceURL and attributionReportAttributeOnURL and sets them
+ in a new struct AttributionReportTestConfig.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
+ (TestWebKitAPI::TEST):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WTR::TestRunner::setPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::setPrivateClickMeasurementAttributionReportURLsForTesting):
+ (WTR::TestController::setPrivateClickMeasurementAttributionReportURLForTesting): Deleted.
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+
2021-03-16 Jonathan Bedard <[email protected]>
[git-webkit] Showing help instead of raising an exception with no command
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm (274512 => 274513)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm 2021-03-16 20:57:04 UTC (rev 274513)
@@ -106,7 +106,7 @@
webView.get()._uiEventAttribution = (UIEventAttribution *)attribution.get();
[[webView configuration].websiteDataStore _setResourceLoadStatisticsEnabled:YES];
[[webView configuration].websiteDataStore _allowTLSCertificateChain:@[(id)testCertificate().get()] forHost:serverURL.host];
- [webView _setPrivateClickMeasurementAttributionReportURLForTesting:serverURL completionHandler:^{
+ [webView _setPrivateClickMeasurementAttributionReportURLsForTesting:serverURL attributeOnURL:exampleURL completionHandler:^{
[webView _setPrivateClickMeasurementOverrideTimerForTesting:YES completionHandler:^{
NSString *html = [NSString stringWithFormat:@"<script>fetch('%@conversionRequestBeforeRedirect',{mode:'no-cors'})</script>", serverURL];
[webView loadHTMLString:html baseURL:exampleURL];
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2021-03-16 20:57:04 UTC (rev 274513)
@@ -406,7 +406,7 @@
undefined simulateResourceLoadStatisticsSessionRestart();
undefined setPrivateClickMeasurementTokenPublicKeyURLForTesting(DOMString url);
undefined setPrivateClickMeasurementTokenSignatureURLForTesting(DOMString url);
- undefined setPrivateClickMeasurementAttributionReportURLForTesting(DOMString url);
+ undefined setPrivateClickMeasurementAttributionReportURLsForTesting(DOMString sourceURLString, DOMString attributeOnURLString);
undefined markPrivateClickMeasurementsAsExpiredForTesting();
undefined setPrivateClickMeasurementFraudPreventionValuesForTesting(DOMString unlinkableToken, DOMString secretToken, DOMString signature, DOMString keyID);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -2043,10 +2043,12 @@
adoptWK(WKURLCreateWithUTF8CString(toWTFString(urlString).utf8().data())));
}
-void TestRunner::setPrivateClickMeasurementAttributionReportURLForTesting(JSStringRef urlString)
+void TestRunner::setPrivateClickMeasurementAttributionReportURLsForTesting(JSStringRef sourceURLString, JSStringRef attributeOnURLString)
{
- postSynchronousPageMessage("SetPrivateClickMeasurementAttributionReportURLForTesting",
- adoptWK(WKURLCreateWithUTF8CString(toWTFString(urlString).utf8().data())));
+ postSynchronousPageMessage("SetPrivateClickMeasurementAttributionReportURLsForTesting", createWKDictionary({
+ { "SourceURLString", toWK(sourceURLString) },
+ { "AttributeOnURLString", toWK(attributeOnURLString) },
+ }));
}
void TestRunner::markPrivateClickMeasurementsAsExpiredForTesting()
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -515,7 +515,7 @@
void setPrivateClickMeasurementOverrideTimerForTesting(bool value);
void setPrivateClickMeasurementTokenPublicKeyURLForTesting(JSStringRef);
void setPrivateClickMeasurementTokenSignatureURLForTesting(JSStringRef);
- void setPrivateClickMeasurementAttributionReportURLForTesting(JSStringRef);
+ void setPrivateClickMeasurementAttributionReportURLsForTesting(JSStringRef sourceURL, JSStringRef attributeOnURL);
void markPrivateClickMeasurementsAsExpiredForTesting();
void markAttributedPrivateClickMeasurementsAsExpiredForTesting();
void setPrivateClickMeasurementFraudPreventionValuesForTesting(JSStringRef unlinkableToken, JSStringRef secretToken, JSStringRef signature, JSStringRef keyID);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -3651,10 +3651,10 @@
runUntil(callbackContext.done, noTimeout);
}
-void TestController::setPrivateClickMeasurementAttributionReportURLForTesting(WKURLRef url)
+void TestController::setPrivateClickMeasurementAttributionReportURLsForTesting(WKURLRef sourceURL, WKURLRef attributeOnURL)
{
PrivateClickMeasurementVoidCallbackContext callbackContext(*this);
- WKPageSetPrivateClickMeasurementAttributionReportURLForTesting(m_mainWebView->page(), url, privateClickMeasurementVoidCallback, &callbackContext);
+ WKPageSetPrivateClickMeasurementAttributionReportURLsForTesting(m_mainWebView->page(), sourceURL, attributeOnURL, privateClickMeasurementVoidCallback, &callbackContext);
runUntil(callbackContext.done, noTimeout);
}
Modified: trunk/Tools/WebKitTestRunner/TestController.h (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/TestController.h 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2021-03-16 20:57:04 UTC (rev 274513)
@@ -349,7 +349,7 @@
void simulateResourceLoadStatisticsSessionRestart();
void setPrivateClickMeasurementTokenPublicKeyURLForTesting(WKURLRef);
void setPrivateClickMeasurementTokenSignatureURLForTesting(WKURLRef);
- void setPrivateClickMeasurementAttributionReportURLForTesting(WKURLRef);
+ void setPrivateClickMeasurementAttributionReportURLsForTesting(WKURLRef sourceURL, WKURLRef attributeOnURL);
void markPrivateClickMeasurementsAsExpiredForTesting();
void setPCMFraudPreventionValuesForTesting(WKStringRef unlinkableToken, WKStringRef secretToken, WKStringRef signature, WKStringRef keyID);
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (274512 => 274513)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2021-03-16 20:51:11 UTC (rev 274512)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2021-03-16 20:57:04 UTC (rev 274513)
@@ -1352,9 +1352,11 @@
return nullptr;
}
- if (WKStringIsEqualToUTF8CString(messageName, "SetPrivateClickMeasurementAttributionReportURLForTesting")) {
- ASSERT(WKGetTypeID(messageBody) == WKURLGetTypeID());
- TestController::singleton().setPrivateClickMeasurementAttributionReportURLForTesting(static_cast<WKURLRef>(messageBody));
+ if (WKStringIsEqualToUTF8CString(messageName, "SetPrivateClickMeasurementAttributionReportURLsForTesting")) {
+ auto testDictionary = dictionaryValue(messageBody);
+ auto sourceURL = WKURLCreateWithUTF8CString(toWTFString(stringValue(testDictionary, "SourceURLString")).utf8().data());
+ auto attributeOnURL = WKURLCreateWithUTF8CString(toWTFString(stringValue(testDictionary, "AttributeOnURLString")).utf8().data());
+ TestController::singleton().setPrivateClickMeasurementAttributionReportURLsForTesting(sourceURL, attributeOnURL);
return nullptr;
}