0

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/+/2235851
Reviewed-by: Pâris Meuleman <pmeuleman@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776930}
This commit is contained in:
arthursonzogni
2020-06-10 13:48:54 +00:00
committed by Commit Bot
parent b2818bde92
commit 84f61c816c

@ -7,6 +7,19 @@ 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}`,
@ -15,7 +28,8 @@ async function pollReports(endpoint) {
return;
}
for (const report of await res.json()) {
endpoint.reports.push(report);
if (isCoopOpenerBreakageReport(report))
endpoint.reports.push(report);
}
}