commit | b8809431112840c82ae80224d3d0a2fc5ca756ac | [log] [tgz] |
---|---|---|
author | Rodney Ding <[email protected]> | Thu Mar 12 22:19:59 2020 |
committer | Commit Bot <[email protected]> | Thu Mar 12 22:19:59 2020 |
tree | c4c53079ab0ff7ec49944f2c2d9b72ab6cfc9789 | |
parent | 52da92d44d158c3e99aab15253355674c241fee1 [diff] [blame] |
Add support for path absolute url to reporting endpoint Add wpt tests to cover reports sent out-of-band to path-absolute-url endpoints. Copying some report infra code from wpt/content-security-policy Github discussions here https://github.com/w3c/reporting/issues/147 Bug: 1060306 Change-Id: I293cb686fd60edd15b28b7ccf7a5a9904b7ea588 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096846 Commit-Queue: Rodney Ding <[email protected]> Reviewed-by: Lily Chen <[email protected]> Reviewed-by: Ian Clelland <[email protected]> Cr-Commit-Position: refs/heads/master@{#749897}
diff --git a/net/reporting/reporting_service_unittest.cc b/net/reporting/reporting_service_unittest.cc index 4fe6e600..96365b1a 100644 --- a/net/reporting/reporting_service_unittest.cc +++ b/net/reporting/reporting_service_unittest.cc
@@ -138,6 +138,18 @@ EXPECT_EQ(1u, context()->cache()->GetEndpointCount()); } +TEST_P(ReportingServiceTest, ProcessHeaderPathAbsolute) { + service()->ProcessHeader(kUrl_, + "{\"endpoints\":[{\"url\":\"/path-absolute\"}]," + "\"group\":\"" + + kGroup_ + + "\"," + "\"max_age\":86400}"); + FinishLoading(true /* load_success */); + + EXPECT_EQ(1u, context()->cache()->GetEndpointCount()); +} + TEST_P(ReportingServiceTest, ProcessHeader_TooLong) { const std::string header_too_long = "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +