Skip to content

Commit

Permalink
PCM: Make JSON key names use underscores according to the W3C convers…
Browse files Browse the repository at this point in the history
…ation

https://bugs.webkit.org/show_bug.cgi?id=219696
<rdar://problem/72143642>

Reviewed by Brent Fulgham.

Further discussion in privacycg/private-click-measurement#30
concluded that the JSON report should use underscores in its keys instead of dashes.
This patch makes that change and shortens the "report_version" key to just "version".

Source/WebCore:

Existing tests updated.

* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::json const):

Tools:

* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

* http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
* http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:


Canonical link: https://commits.webkit.org/232267@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
johnwilander committed Dec 9, 2020
1 parent 251ddb7 commit 5fd26a7
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 11 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2020-12-09 John Wilander <[email protected]>

PCM: Make JSON key names use underscores according to the W3C conversation
https://bugs.webkit.org/show_bug.cgi?id=219696
<rdar://problem/72143642>

Reviewed by Brent Fulgham.

Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
concluded that the JSON report should use underscores in its keys instead of dashes.
This patch makes that change and shortens the "report_version" key to just "version".

* http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
* http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:

2020-12-09 Antti Koivisto <[email protected]>

Font loads are triggered too late
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Content type: application/json
REQUEST_URI: /privateClickMeasurement/resources/conversionReport.php
No cookies in attribution request.
Request body:
{"source-engagement-type":"click","source-site":"127.0.0.1","source-id":3,"attributed-on-site":"localhost","trigger-data":12,"report-version":1}
{"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":1}


No stored Private Click Measurement data.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Content type: application/json
REQUEST_URI: /privateClickMeasurement/resources/conversionReport.php
No cookies in attribution request.
Request body:
{"source-engagement-type":"click","source-site":"127.0.0.1","source-id":3,"attributed-on-site":"localhost","trigger-data":12,"report-version":1}
{"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":1}


--------
Expand Down
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2020-12-09 John Wilander <[email protected]>

PCM: Make JSON key names use underscores according to the W3C conversation
https://bugs.webkit.org/show_bug.cgi?id=219696
<rdar://problem/72143642>

Reviewed by Brent Fulgham.

Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
concluded that the JSON report should use underscores in its keys instead of dashes.
This patch makes that change and shortens the "report_version" key to just "version".

Existing tests updated.

* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::json const):

2020-12-09 Antoine Quint <[email protected]>

text-decoration-color animation should not be discrete
Expand Down
12 changes: 6 additions & 6 deletions Source/WebCore/loader/PrivateClickMeasurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ Ref<JSON::Object> PrivateClickMeasurement::json() const
if (!m_attributionTriggerData || !isValid())
return reportDetails;

reportDetails->setString("source-engagement-type"_s, "click"_s);
reportDetails->setString("source-site"_s, m_sourceSite.registrableDomain.string());
reportDetails->setInteger("source-id"_s, m_sourceID.id);
reportDetails->setString("attributed-on-site"_s, m_attributeOnSite.registrableDomain.string());
reportDetails->setInteger("trigger-data"_s, m_attributionTriggerData->data);
reportDetails->setInteger("report-version"_s, 1);
reportDetails->setString("source_engagement_type"_s, "click"_s);
reportDetails->setString("source_site"_s, m_sourceSite.registrableDomain.string());
reportDetails->setInteger("source_id"_s, m_sourceID.id);
reportDetails->setString("attributed_on_site"_s, m_attributeOnSite.registrableDomain.string());
reportDetails->setInteger("trigger_data"_s, m_attributionTriggerData->data);
reportDetails->setInteger("version"_s, 1);
return reportDetails;
}

Expand Down
15 changes: 15 additions & 0 deletions Tools/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2020-12-09 John Wilander <[email protected]>

PCM: Make JSON key names use underscores according to the W3C conversation
https://bugs.webkit.org/show_bug.cgi?id=219696
<rdar://problem/72143642>

Reviewed by Brent Fulgham.

Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
concluded that the JSON report should use underscores in its keys instead of dashes.
This patch makes that change and shortens the "report_version" key to just "version".

* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):

2020-12-09 Alex Christensen <[email protected]>

Make PDFHUD.MoveIFrame API test more robust
Expand Down
6 changes: 3 additions & 3 deletions Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST(PrivateClickMeasurement, ValidMinValues)

ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");

ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":0,\"attributed-on-site\":\"example.com\",\"trigger-data\":0,\"report-version\":1}");
ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":0,\"attributed_on_site\":\"example.com\",\"trigger_data\":0,\"version\":1}");
}

TEST(PrivateClickMeasurement, ValidMidValues)
Expand All @@ -62,7 +62,7 @@ TEST(PrivateClickMeasurement, ValidMidValues)

ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");

ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":192,\"attributed-on-site\":\"example.com\",\"trigger-data\":9,\"report-version\":1}");
ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":192,\"attributed_on_site\":\"example.com\",\"trigger_data\":9,\"version\":1}");
}

TEST(PrivateClickMeasurement, ValidMaxValues)
Expand All @@ -74,7 +74,7 @@ TEST(PrivateClickMeasurement, ValidMaxValues)

ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");

ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":255,\"attributed-on-site\":\"example.com\",\"trigger-data\":15,\"report-version\":1}");
ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":255,\"attributed_on_site\":\"example.com\",\"trigger_data\":15,\"version\":1}");
}

TEST(PrivateClickMeasurement, EarliestTimeToSendAttributionMinimumDelay)
Expand Down

0 comments on commit 5fd26a7

Please sign in to comment.