Commit d6e92c10 authored by Pâris MEULEMAN's avatar Pâris MEULEMAN Committed by Commit Bot

[COOP] Make the failed output of reporting tests more stable in order to use expectations

Make the failed output of Coop reporting tests more stable in order to use expectations

Bug: 1099208
Change-Id: Ib1b516bc03295eb243d2db3c33ee4bc9db8b89df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279819
Commit-Queue: Pâris Meuleman <pmeuleman@chromium.org>
Auto-Submit: Pâris Meuleman <pmeuleman@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786317}
parent 21069c2d
......@@ -2788,12 +2788,8 @@ crbug.com/626703 [ Linux ] external/wpt/mathml/presentation-markup/operators/mo-
crbug.com/626703 [ Mac ] external/wpt/mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html [ Failure ]
crbug.com/626703 [ Win ] external/wpt/mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html [ Failure ]
crbug.com/626703 [ Retina ] external/wpt/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html [ Timeout ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-four-reports.https.html [ Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-from-unsafe-none.https.html [ Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html [ Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin.https.html [ Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin.https.html [ Crash Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin-coep-report-to.https.html [ Crash Failure ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin.https.html [ Crash ]
crbug.com/1099208 external/wpt/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin-coep-report-to.https.html [ Crash ]
crbug.com/626703 [ Mac10.14 ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ]
crbug.com/626703 [ Win ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ]
crbug.com/626703 [ Mac10.14 ] external/wpt/preload/onload-event.html [ Timeout ]
......
This is a testharness.js-based test.
FAIL coop reporting test A test with both COOP and COOP report only setup to CROSS_ORIGIN with same-origin-allow-popups; report-to="coop-popup-report-endpoint", require-corp, same-origin; report-to="coop-popup-report-only-endpoint", require-corp promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-four-reports.https.html\",\"effective-policy\":\"same-origin-plus-coep\",\"navigation-uri\":\"/uuid=(uuid)$/\",\"violation-type\":\"navigation-from-document\"},\"url\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-four-reports.https.html\",\"type\":\"coop\"}, within available reports: []"
PASS verify remaining reports
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL coop reporting test Report only tests for an opener without any COOP/COOP report only set to SAME_ORIGIN with , , same-origin; report-to="coop-popup-report-only-endpoint", promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-popup-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"/uuid=(uuid)$/\",\"effective-policy\":\"same-origin\",\"navigation-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-from-unsafe-none.https.html\",\"violation-type\":\"navigation-to-document\"},\"url\":\"/uuid=(uuid)$/\",\"type\":\"coop\"}, within available reports: []"
FAIL coop reporting test Report only tests for an opener without any COOP/COOP report only set to CROSS_ORIGIN with , , same-origin; report-to="coop-popup-report-only-endpoint", promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-popup-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"/uuid=(uuid)$/\",\"effective-policy\":\"same-origin\",\"navigation-uri\":\"https://web-platform.test:8444/\",\"violation-type\":\"navigation-to-document\"},\"url\":\"/uuid=(uuid)$/\",\"type\":\"coop\"}, within available reports: []"
PASS verify remaining reports
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL coop reporting test reporting same origin with report-to to CROSS_ORIGIN with , , , promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html\",\"effective-policy\":\"same-origin\",\"navigation-uri\":\"/uuid=(uuid)$/\",\"violation-type\":\"navigation-from-document\"},\"url\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html\",\"type\":\"coop\"}, within available reports: []"
FAIL coop reporting test reporting same origin with report-to to CROSS_ORIGIN with , , same-origin; report-to="coop-popup-report-only-endpoint", promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html\",\"effective-policy\":\"same-origin\",\"navigation-uri\":\"/uuid=(uuid)$/\",\"violation-type\":\"navigation-from-document\"},\"url\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html\",\"type\":\"coop\"}, within available reports: []"
PASS coop reporting test reporting same origin with report-to to SAME_ORIGIN with , , same-origin; report-to="coop-popup-report-only-endpoint",
PASS verify remaining reports
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL coop reporting test reporting same origin with report-to to SAME_ORIGIN with , require-corp, same-origin; report-to="coop-popup-report-only-endpoint", promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-popup-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"/uuid=(uuid)$/\",\"effective-policy\":\"same-origin-plus-coep\",\"navigation-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin.https.html\",\"violation-type\":\"navigation-to-document\"},\"url\":\"/uuid=(uuid)$/\",\"type\":\"coop\"}, within available reports: []"
FAIL coop reporting test reporting same origin with report-to to SAME_ORIGIN with , , same-origin; report-to="coop-popup-report-only-endpoint", require-corp promise_test: Unhandled rejection with value: "No report matched the expected report for endpoint: coop-popup-report-only-endpoint, expected report: {\"body\":{\"disposition\":\"reporting\",\"document-uri\":\"/uuid=(uuid)$/\",\"effective-policy\":\"same-origin-plus-coep\",\"navigation-uri\":\"https://web-platform.test:8444/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin.https.html\",\"violation-type\":\"navigation-to-document\"},\"url\":\"/uuid=(uuid)$/\",\"type\":\"coop\"}, within available reports: []"
PASS verify remaining reports
Harness: the test ran to completion.
......@@ -76,12 +76,14 @@ async function checkForExpectedReport(expectedReport) {
};
await wait(waitTime);
}
reject("No report matched the expected report for endpoint: "
+ expectedReport.endpoint.name
+ ", expected report: " + JSON.stringify(expectedReport.report)
+ ", within available reports: "
+ JSON.stringify(expectedReport.endpoint.reports)
);
reject(
replaceTokensInReceivedReport(
"No report matched the expected report for endpoint: "
+ expectedReport.endpoint.name
+ ", expected report: " + JSON.stringify(expectedReport.report)
+ ", within available reports: "
+ JSON.stringify(expectedReport.endpoint.reports)
));
});
}
......@@ -114,6 +116,10 @@ function replaceValuesInExpectedReport(expectedReport, executorUuid) {
return expectedReport;
}
function replaceTokensInReceivedReport(str) {
return str.replace(/.{8}-.{4}-.{4}-.{4}-.{12}/g, `(uuid)`);
}
// Run a test (such as coop_coep_test from ./common.js) then check that all
// expected reports are present.
async function reportingTest(testFunction, executorToken, expectedReports) {
......
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