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:

committed by
Commit Bot

parent
b2818bde92
commit
84f61c816c
16
third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/resources/reporting-common.js
vendored
16
third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/resources/reporting-common.js
vendored
@@ -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) {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user