Commit 84f61c81 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Exclude non relevants reports from the COOP-opener-breakage tests.

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/+/2235851Reviewed-by: default avatarPâris Meuleman <pmeuleman@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776930}
parent b2818bde
...@@ -7,6 +7,19 @@ function wait(ms) { ...@@ -7,6 +7,19 @@ function wait(ms) {
return new Promise(resolve => step_timeout(resolve, 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) { async function pollReports(endpoint) {
const res = await fetch( const res = await fetch(
`resources/report.py?endpoint=${endpoint.name}`, `resources/report.py?endpoint=${endpoint.name}`,
...@@ -15,7 +28,8 @@ async function pollReports(endpoint) { ...@@ -15,7 +28,8 @@ async function pollReports(endpoint) {
return; return;
} }
for (const report of await res.json()) { for (const report of await res.json()) {
endpoint.reports.push(report); if (isCoopOpenerBreakageReport(report))
endpoint.reports.push(report);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment