Skip to content

Conversation

@brentfulgham
Copy link
Contributor

@brentfulgham brentfulgham commented Oct 11, 2022

8ae6f49

[Reporting API] Test reports should go "Reporting-Endpoints" Endpoints
https://bugs.webkit.org/show_bug.cgi?id=244907
<rdar://problem/99666423>

Reviewed by Chris Dumez.

Test reports should be sent to any endpoints provided in a "Reporting-Endpoints" header.
There also don't appear to be WPT that check this behavior. This patch implements
this part of the spec, and adds tests.

It also connects 'generateTestReport' to WebKitLegacy so we can exercise the code in DumpRenderTree.

* LayoutTests/http/tests/security/contentSecurityPolicy: Rebasedlined tests.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html.sub.headers: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub-expected: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub.html.sub.headers: Added.
* LayoutTests/platform/gtk/TestExpectations: Mark http-based WPT as expected to fail.
* LayoutTests/platform/mac-wk1/TestExpectations: Mark https-based WPT as expected to fail.
* Source/WebCore/Modules/reporting/Report.cpp:
(WebCore::Report::createReportFormDataForViolation):
* Source/WebCore/Modules/reporting/Report.h:
* Source/WebCore/Modules/reporting/ReportingScope.cpp:
(WebCore::ReportingScope::generateTestReport):
* Source/WebCore/Modules/reporting/TestReportBody.cpp:
(WebCore::TestReportBody::createReportFormDataForViolation const): Deleted.
* Source/WebCore/Modules/reporting/TestReportBody.h:
* Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::sendCOEPInheritenceViolation):
(WebCore::sendCOEPCORPViolation):
* Source/WebCore/loader/CrossOriginOpenerPolicy.cpp:
(WebCore::sendViolationReportWhenNavigatingToCOOPResponse):
(WebCore::sendViolationReportWhenNavigatingAwayFromCOOPResponse):
* Source/WebCore/page/csp/CSPViolationReportBody.cpp:
(WebCore::CSPViolationReportBody::createReportFormDataForViolation const):
* Source/WebCore/page/csp/CSPViolationReportBody.h:
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm
(-[WebFrame _generateTestReport:withGroup:]): Added.
* Source/WebKitLegacy/mac/WebView/WebFramePrivate.h
* Tools/DumpRenderTree/TestRunner.cpp
(generateTestReportCallback): Add support for 'generateTestReport'.
(TestRunner::staticFunctions): Ditto.
* Tools/DumpRenderTree/TestRunner.h
* Tools/DumpRenderTree/mac/TestRunnerMac.mm
(TestRunner::generateTestReport): Added.
* Tools/DumpRenderTree/win/TestRunnerWin.cpp
(TestRunner::generateTestReport): Added stub.

Canonical link: https://commits.webkit.org/255845@main

dc0e2cc

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios 🛠 mac ✅ 🛠 wpe ✅ 🛠 🧪 win
✅ 🛠 ios-sim ✅ 🛠 mac-debug ✅ 🛠 gtk 🛠 wincairo
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🛠 mac-AS-debug 🧪 gtk-wk2
✅ 🧪 api-ios 🧪 api-mac 🧪 api-gtk
✅ 🛠 tv 🧪 mac-wk1
✅ 🛠 tv-sim 🧪 mac-wk2
✅ 🛠 🧪 merge ✅ 🛠 watch 🧪 mac-AS-debug-wk2
✅ 🛠 watch-sim 🧪 mac-wk2-stress

@brentfulgham brentfulgham requested a review from cdumez as a code owner October 11, 2022 00:10
@brentfulgham brentfulgham self-assigned this Oct 11, 2022
@brentfulgham brentfulgham added WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). WebKit Nightly Build labels Oct 11, 2022
@brentfulgham brentfulgham marked this pull request as draft October 11, 2022 00:11
@brentfulgham
Copy link
Contributor Author

Note: This is a WIP. New tests are not in this patch yet.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 11, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 12, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from dcf847b to 91819e1 Compare October 12, 2022 23:36
@brentfulgham brentfulgham changed the title [Reporting API] Test reports should go "Reporting-Endpoints" Endpoints [Reporting API] Test reports should go to "Reporting-Endpoints" Endpoints Oct 12, 2022
@brentfulgham brentfulgham changed the title [Reporting API] Test reports should go to "Reporting-Endpoints" Endpoints [Reporting API] Test reports should go "Reporting-Endpoints" Endpoints Oct 12, 2022
@brentfulgham brentfulgham changed the title [Reporting API] Test reports should go "Reporting-Endpoints" Endpoints Need a short description (OOPS!). Oct 12, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from ec7e620 to 5191a4c Compare October 12, 2022 23:52
@brentfulgham brentfulgham changed the title Need a short description (OOPS!). [Reporting API] Test reports should go "Reporting-Endpoints" Endpoints Oct 12, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 13, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 13, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 5191a4c to 4cc3cd2 Compare October 13, 2022 19:36
@brentfulgham brentfulgham marked this pull request as ready for review October 13, 2022 19:46
@cdumez
Copy link
Contributor

cdumez commented Oct 13, 2022

This patch implements
this part of the spec, and adds tests.

Where are the tests?

@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 4cc3cd2 to e7ab03b Compare October 13, 2022 19:57
@brentfulgham
Copy link
Contributor Author

This patch implements
this part of the spec, and adds tests.

Where are the tests?

They should be in the PR now.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 14, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 14, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from e7ab03b to 1fb28ee Compare October 14, 2022 20:38
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 14, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 17, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 1fb28ee to bda3b48 Compare October 17, 2022 22:32
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from bda3b48 to 5ec0faa Compare October 17, 2022 22:48
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 17, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 18, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 5ec0faa to 3ff1d45 Compare October 18, 2022 23:21
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 19, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 19, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 3ff1d45 to 149ecb0 Compare October 19, 2022 17:54
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 19, 2022
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Oct 19, 2022
@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from 149ecb0 to c5f5fec Compare October 19, 2022 21:00
@brentfulgham
Copy link
Contributor Author

I'm skeptical of the API test failure, since the tests have been passing consistently in earlier patches, and I've only been adjusting DumpRenderTree and test cases, not engine code in recent updates.

Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor fixes.

@brentfulgham brentfulgham force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from c5f5fec to dc0e2cc Compare October 21, 2022 19:10
@brentfulgham brentfulgham requested a review from rniwa as a code owner October 21, 2022 19:10
@brentfulgham brentfulgham added the merge-queue Applied to send a pull request to merge-queue label Oct 21, 2022
https://bugs.webkit.org/show_bug.cgi?id=244907
<rdar://problem/99666423>

Reviewed by Chris Dumez.

Test reports should be sent to any endpoints provided in a "Reporting-Endpoints" header.
There also don't appear to be WPT that check this behavior. This patch implements
this part of the spec, and adds tests.

It also connects 'generateTestReport' to WebKitLegacy so we can exercise the code in DumpRenderTree.

* LayoutTests/http/tests/security/contentSecurityPolicy: Rebasedlined tests.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html.sub.headers: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub-expected: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.http.sub.html.sub.headers: Added.
* LayoutTests/platform/gtk/TestExpectations: Mark http-based WPT as expected to fail.
* LayoutTests/platform/mac-wk1/TestExpectations: Mark https-based WPT as expected to fail.
* Source/WebCore/Modules/reporting/Report.cpp:
(WebCore::Report::createReportFormDataForViolation):
* Source/WebCore/Modules/reporting/Report.h:
* Source/WebCore/Modules/reporting/ReportingScope.cpp:
(WebCore::ReportingScope::generateTestReport):
* Source/WebCore/Modules/reporting/TestReportBody.cpp:
(WebCore::TestReportBody::createReportFormDataForViolation const): Deleted.
* Source/WebCore/Modules/reporting/TestReportBody.h:
* Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::sendCOEPInheritenceViolation):
(WebCore::sendCOEPCORPViolation):
* Source/WebCore/loader/CrossOriginOpenerPolicy.cpp:
(WebCore::sendViolationReportWhenNavigatingToCOOPResponse):
(WebCore::sendViolationReportWhenNavigatingAwayFromCOOPResponse):
* Source/WebCore/page/csp/CSPViolationReportBody.cpp:
(WebCore::CSPViolationReportBody::createReportFormDataForViolation const):
* Source/WebCore/page/csp/CSPViolationReportBody.h:
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm
(-[WebFrame _generateTestReport:withGroup:]): Added.
* Source/WebKitLegacy/mac/WebView/WebFramePrivate.h
* Tools/DumpRenderTree/TestRunner.cpp
(generateTestReportCallback): Add support for 'generateTestReport'.
(TestRunner::staticFunctions): Ditto.
* Tools/DumpRenderTree/TestRunner.h
* Tools/DumpRenderTree/mac/TestRunnerMac.mm
(TestRunner::generateTestReport): Added.
* Tools/DumpRenderTree/win/TestRunnerWin.cpp
(TestRunner::generateTestReport): Added stub.

Canonical link: https://commits.webkit.org/255845@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Reporting-API-Test-reports-should-go-Reporting-Endpoints-Endpoints branch from dc0e2cc to 8ae6f49 Compare October 21, 2022 20:21
@webkit-commit-queue
Copy link
Collaborator

Committed 255845@main (8ae6f49): https://commits.webkit.org/255845@main

Reviewed commits have been landed. Closing PR #5216 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 8ae6f49 into WebKit:main Oct 21, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants