[COOP] access reporting: expose "type" to ReportingObserver. (#25920)

This makes network reports and ReportingObserver's report similar.

Bug: 1090273
Change-Id: I0fce6f0a25153e6f32feaeaf713d44ab081c1a97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436533
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812686}

Co-authored-by: arthursonzogni <arthursonzogni@chromium.org>
diff --git a/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html b/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html
index 435f647..1d73b56 100644
--- a/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html
+++ b/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html
@@ -63,6 +63,8 @@
   assert_equals(report_access_from[0].type, "coop-access-violation");
   assert_equals(report_access_from[0].url, opener_url.replace(/"/g, '%22'));
   assert_source_location_found(report_access_from[0])
+  assert_equals(report_access_from[0].body.type,
+                "access-from-coop-page-to-openee");
 
   // 5. The openee tries to access its opener. No reports for blocked access
   //    to the COOP page should be dispatched.
@@ -118,6 +120,8 @@
   assert_equals(report_access_from[0].url, openee_url.replace(/"/g, '%22'));
   assert_true(report_access_from[0].body.sourceFile.includes("try-access.js"));
   assert_source_location_found(report_access_from[0])
+  assert_equals(report_access_from[0].body.type,
+                "access-from-coop-page-to-opener");
 
   // 4. The opener tries to access its openee. No reports for blocked access
   //    to the COOP page should be dispatched.
@@ -192,6 +196,8 @@
   assert_equals(reports[0].url, opener_url.replace(/"/g, '%22'));
   assert_true(reports[0].body.sourceFile.includes("try-access.js"));
   assert_source_location_found(reports[0]);
+  assert_equals(reports[0].body.type,
+                "access-from-coop-page-to-openee");
 }, "Access from same-origin iframe")
 
 promise_test(async t => {