Bug 1645216 [wpt PR 24122] - Exclude non relevants reports from the COOP-opener-breakage tests., a=testonly
authorBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Mon, 22 Jun 2020 10:42:03 +0000
changeset 536822 8c46d41711c4c39505fc6303c203fb42a6b0b646
parent 536821 971c73c56b5a4bf4a860986fcc0d71503bb93d26
child 536823 5999464804d54d48e0f86663ec2fc4fc47c41696
push id37533
push userdluca@mozilla.com
push dateTue, 23 Jun 2020 21:38:40 +0000
treeherdermozilla-central@d48aa0f0aa0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1645216, 24122, 1090273, 2235851, 776930
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1645216 [wpt PR 24122] - Exclude non relevants reports from the COOP-opener-breakage tests., a=testonly Automatic update from web-platform-tests Exclude non relevants reports from the COOP-opener-breakage tests. (#24122) Without this, several reports from COOP-access-reporting would show in between and cause most of the tests to fail. BUG=1090273 Change-Id: I360b82da4b6a2dcb0380dfa4dce5a678e6ad73a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2235851 Reviewed-by: Pâris Meuleman <pmeuleman@chromium.org> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#776930} Co-authored-by: arthursonzogni <arthursonzogni@chromium.org> -- wpt-commits: 1f3fadc328924b3a105b34c2c47b1a3d2aafcbf3 wpt-pr: 24122
testing/web-platform/tests/html/cross-origin-opener-policy/resources/reporting-common.js
--- a/testing/web-platform/tests/html/cross-origin-opener-policy/resources/reporting-common.js
+++ b/testing/web-platform/tests/html/cross-origin-opener-policy/resources/reporting-common.js
@@ -2,25 +2,39 @@
 Object.defineProperty(RegExp.prototype, "toJSON", {
   value: RegExp.prototype.toString
 });
 
 function wait(ms) {
   return new Promise(resolve => step_timeout(resolve, ms));
 }
 
+// Check whether a |report| is a "opener breakage" COOP report.
+function isCoopOpenerBreakageReport(report) {
+  if (report.type != "coop")
+    return false;
+
+  if (report.body["violation-type"] != "navigation-from-document" &&
+      report.body["violation-type"] != "navigation-to-document") {
+    return false;
+  }
+
+  return true;
+}
+
 async function pollReports(endpoint) {
   const res = await fetch(
       `resources/report.py?endpoint=${endpoint.name}`,
       {cache: 'no-store'});
   if (res.status !== 200) {
     return;
   }
   for (const report of await res.json()) {
-    endpoint.reports.push(report);
+    if (isCoopOpenerBreakageReport(report))
+      endpoint.reports.push(report);
   }
 }
 
 // Recursively check that all members of expectedReport are present or matched
 // in report.
 // Report may have members not explicitly expected by expectedReport.
 function isObjectAsExpected(report, expectedReport) {
   if (( report === undefined || report === null