Changeset 285170 in webkit


Ignore:
Timestamp:
Nov 2, 2021 11:36:32 AM (9 months ago)
Author:
Kate Cheney
Message:

PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
https://bugs.webkit.org/show_bug.cgi?id=228104
<rdar://problem/80991209>

Reviewed by John Wilander.

Source/WebCore:

No new tests. Several existing tests would timeout with the removal of
m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds)
if the fix wasn't in place.

  • loader/PrivateClickMeasurement.cpp:

(WebCore::randomlyBetweenTwentyFourAndFortyEightHours):
(WebCore::PrivateClickMeasurement::attributeAndGetEarliestTimeToSend):

  • loader/PrivateClickMeasurement.h:

Source/WebKit:

firePendingAttributionRequests() was sometimes scheduling the next timer
fire to be the raw time value instead of the difference between now
and the scheduled send time. This was resulting in some reports not being
sent within the 24-48 hour range.

To test this, this patch removes the immediate timer fire for testing
and instead sets the earliest time to send values to both be 1 second.
This will test that the proper timer gets set to send both reports.

  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:

(WebKit::PCM::Database::attributePrivateClickMeasurement):

  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:

(WebKit::PrivateClickMeasurementManager::startTimer):
(WebKit::PrivateClickMeasurementManager::attribute):
(WebKit::PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes const):
(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
In the case of both times being past due to report, schedule one for
15 - 30 minutes later.

  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:

(WebKit::PCM::Store::attributePrivateClickMeasurement):

  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:

Tools:

  • TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r285169 r285170  
     12021-11-02  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
     4        https://bugs.webkit.org/show_bug.cgi?id=228104
     5        <rdar://problem/80991209>
     6
     7        Reviewed by John Wilander.
     8
     9        No new tests. Several existing tests would timeout with the removal of
     10        m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds)
     11        if the fix wasn't in place.
     12
     13        * loader/PrivateClickMeasurement.cpp:
     14        (WebCore::randomlyBetweenTwentyFourAndFortyEightHours):
     15        (WebCore::PrivateClickMeasurement::attributeAndGetEarliestTimeToSend):
     16        * loader/PrivateClickMeasurement.h:
     17
    1182021-11-02  Tyler Wilcock  <tyler_w@apple.com>
    219
  • trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp

    r283316 r285170  
    148148}
    149149
    150 static Seconds randomlyBetweenTwentyFourAndFortyEightHours()
    151 {
    152     return 24_h + Seconds(randomNumber() * (24_h).value());
    153 }
    154 
    155 PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData)
     150static Seconds randomlyBetweenTwentyFourAndFortyEightHours(PrivateClickMeasurement::IsRunningLayoutTest isRunningTest)
     151{
     152    return isRunningTest == PrivateClickMeasurement::IsRunningLayoutTest::Yes ? 1_s : 24_h + Seconds(randomNumber() * (24_h).value());
     153}
     154
     155PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData, IsRunningLayoutTest isRunningTest)
    156156{
    157157    if (!attributionTriggerData.isValid() || (m_attributionTriggerData && m_attributionTriggerData->priority >= attributionTriggerData.priority))
     
    161161    // 24-48 hour delay before sending. This helps privacy since the conversion and the attribution
    162162    // requests are detached and the time of the attribution does not reveal the time of the conversion.
    163     auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
    164     auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
     163    auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
     164    auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
    165165    m_timesToSend = { WallTime::now() + sourceSecondsUntilSend, WallTime::now() + destinationSecondsUntilSend };
    166166
  • trunk/Source/WebCore/loader/PrivateClickMeasurement.h

    r283316 r285170  
    5555    enum class PcmDataCarried : bool { NonPersonallyIdentifiable, PersonallyIdentifiable };
    5656    enum class AttributionReportEndpoint : bool { Source, Destination };
     57    enum class IsRunningLayoutTest : bool { No, Yes };
    5758
    5859    struct SourceID {
     
    315316    WEBCORE_EXPORT static const Seconds maxAge();
    316317    WEBCORE_EXPORT static Expected<AttributionTriggerData, String> parseAttributionRequest(const URL& redirectURL);
    317     WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&);
     318    WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&, IsRunningLayoutTest);
    318319    WEBCORE_EXPORT bool hasHigherPriorityThan(const PrivateClickMeasurement&) const;
    319320    WEBCORE_EXPORT URL attributionReportSourceURL() const;
  • trunk/Source/WebKit/ChangeLog

    r285165 r285170  
     12021-11-02  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
     4        https://bugs.webkit.org/show_bug.cgi?id=228104
     5        <rdar://problem/80991209>
     6
     7        Reviewed by John Wilander.
     8
     9        firePendingAttributionRequests() was sometimes scheduling the next timer
     10        fire to be the raw time value instead of the difference between now
     11        and the scheduled send time. This was resulting in some reports not being
     12        sent within the 24-48 hour range.
     13
     14        To test this, this patch removes the immediate timer fire for testing
     15        and instead sets the earliest time to send values to both be 1 second.
     16        This will test that the proper timer gets set to send both reports.
     17
     18        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
     19        (WebKit::PCM::Database::attributePrivateClickMeasurement):
     20        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
     21        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
     22        (WebKit::PrivateClickMeasurementManager::startTimer):
     23        (WebKit::PrivateClickMeasurementManager::attribute):
     24        (WebKit::PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes const):
     25        (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
     26        In the case of both times being past due to report, schedule one for
     27        15 - 30 minutes later.
     28
     29        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
     30        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
     31        (WebKit::PCM::Store::attributePrivateClickMeasurement):
     32        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:
     33
    1342021-11-02  Simon Fraser  <simon.fraser@apple.com>
    235
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp

    r284710 r285170  
    273273}
    274274
    275 std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> Database::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData)
     275std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> Database::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, WebCore::PrivateClickMeasurement::IsRunningLayoutTest isRunningTest)
    276276{
    277277    ASSERT(!RunLoop::isMain());
     
    299299        // Always convert the pending attribution and remove it from the unattributed map.
    300300        removeUnattributed(*previouslyUnattributed);
    301         secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
     301        secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
    302302
    303303        // We should always have a valid secondsUntilSend value for a previouslyUnattributed value because there can be no previous attribution with a higher priority.
     
    321321        // not been sent to the source or destination site yet.
    322322        if (!previouslyAttributed.value().hasPreviouslyBeenReported()) {
    323             auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
     323            auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
    324324            if (!secondsUntilSend.hasValidSecondsUntilSendValues())
    325325                return { std::nullopt, WTFMove(debugInfo) };
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h

    r284710 r285170  
    4646
    4747    void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
    48     std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&);
     48    std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, WebCore::PrivateClickMeasurement::IsRunningLayoutTest);
    4949    Vector<WebCore::PrivateClickMeasurement> allAttributedPrivateClickMeasurement();
    5050    void clearPrivateClickMeasurement(std::optional<WebCore::RegistrableDomain>);
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp

    r284051 r285170  
    274274void PrivateClickMeasurementManager::startTimer(Seconds seconds)
    275275{
    276     m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds);
     276    m_firePendingAttributionRequestsTimer.startOneShot(seconds);
    277277}
    278278
     
    282282        return;
    283283
    284     store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), [this, weakThis = WeakPtr { *this }] (auto attributionSecondsUntilSendData, auto debugInfo) {
     284    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), m_isRunningTest ? WebCore::PrivateClickMeasurement::IsRunningLayoutTest::Yes : WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No, [this, weakThis = WeakPtr { *this }] (auto attributionSecondsUntilSendData, auto debugInfo) {
    285285        if (!weakThis)
    286286            return;
     
    383383}
    384384
     385Seconds PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes() const
     386{
     387    if (m_isRunningTest)
     388        return 0_s;
     389
     390    return debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
     391}
     392
    385393void PrivateClickMeasurementManager::firePendingAttributionRequests()
    386394{
     
    409417                    // a random time between 15 and 30 minutes to avoid a burst of simultaneous attributions. If debug
    410418                    // mode is enabled, this should be much shorter for easy testing.
    411                     auto interval = debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
    412                     startTimer(interval);
     419                    startTimer(randomlyBetweenFifteenAndThirtyMinutes());
    413420                    return;
    414421                }
     
    421428                // Update nextTimeToFire in case the later report time for this attribution is sooner than the scheduled next time to fire.
    422429                // Or, if debug mode is enabled, we should send the second report on a much shorter delay for easy testing.
    423                 if (laterTimeToSend)
    424                     nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
    425 
     430                if (laterTimeToSend) {
     431                    Seconds laterTimeToSendInSecondsFromNow = (*laterTimeToSend - WallTime::now());
     432                    // Avoid sending expired attributions in bursts by using a random 15-30 minute interval if laterTimeToSend is expired.
     433                    laterTimeToSendInSecondsFromNow = laterTimeToSendInSecondsFromNow.value() < 0 ? randomlyBetweenFifteenAndThirtyMinutes() : laterTimeToSendInSecondsFromNow;
     434                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSendInSecondsFromNow);
     435                }
    426436                continue;
    427437            }
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h

    r284051 r285170  
    8383    bool featureEnabled() const;
    8484    bool debugModeEnabled() const;
     85    Seconds randomlyBetweenFifteenAndThirtyMinutes() const;
    8586
    8687    RunLoop::Timer<PrivateClickMeasurementManager> m_firePendingAttributionRequestsTimer;
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp

    r284710 r285170  
    9595}
    9696
    97 void Store::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&& completionHandler)
     97void Store::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, WebCore::PrivateClickMeasurement::IsRunningLayoutTest isRunningTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&& completionHandler)
    9898{
    99     postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), completionHandler = WTFMove(completionHandler)] () mutable {
     99    postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), isRunningTest, completionHandler = WTFMove(completionHandler)] () mutable {
    100100        if (!m_database) {
    101101            return postTaskReply([completionHandler = WTFMove(completionHandler)] () mutable {
     
    104104        }
    105105
    106         auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData));
     106        auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), isRunningTest);
    107107
    108108        postTaskReply([seconds = WTFMove(seconds), debugInfo = debugInfo.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h

    r283383 r285170  
    5454
    5555    void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
    56     void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
     56    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, WebCore::PrivateClickMeasurement::IsRunningLayoutTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
    5757
    5858    void privateClickMeasurementToStringForTesting(CompletionHandler<void(String)>&&) const;
  • trunk/Tools/ChangeLog

    r285168 r285170  
     12021-11-02  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
     4        https://bugs.webkit.org/show_bug.cgi?id=228104
     5        <rdar://problem/80991209>
     6
     7        Reviewed by John Wilander.
     8
     9        * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
     10        (TestWebKitAPI::TEST):
     11
    1122021-11-02  Tim Horton  <timothy_horton@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp

    r284890 r285170  
    4646{
    4747    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    48     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
     48    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    4949
    5050    auto attributionSourceURL = attribution.attributionReportSourceURL();
     
    5757{
    5858    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    59     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
     59    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    6060
    6161    ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":0,\"attributed_on_site\":\"example.com\",\"trigger_data\":0,\"version\":2}");
     
    6565{
    6666    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID((uint32_t)192), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    67     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)));
     67    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    6868
    6969    ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":192,\"attributed_on_site\":\"example.com\",\"trigger_data\":9,\"version\":2}");
     
    7373{
    7474    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    75     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
     75    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    7676
    7777    ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":255,\"attributed_on_site\":\"example.com\",\"trigger_data\":15,\"version\":2}");
     
    8282    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    8383    auto now = WallTime::now();
    84     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
     84    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    8585    auto earliestTimeToSend = attribution.timesToSend();
    8686    ASSERT_TRUE(earliestTimeToSend.sourceEarliestTimeToSend && earliestTimeToSend.destinationEarliestTimeToSend);
     
    136136{
    137137    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { emptyURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    138     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
     138    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    139139
    140140    ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     
    145145{
    146146    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { emptyURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    147     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
     147    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    148148
    149149    ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     
    154154{
    155155    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    156     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
     156    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    157157
    158158    ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     
    163163{
    164164    PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
    165     attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)));
     165    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
    166166
    167167    ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
Note: See TracChangeset for help on using the changeset viewer.