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() +