Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<head>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<link rel="stylesheet" href="./resources/compressed.css?pipe=gzip">
</head>
<body>
<script>
document.addEventListener('DOMContentLoaded', () => {
const check_report_format = ([reports, observer], resourceUrl) => {
const report = reports[0];
assert_equals(report.type, "document-policy-violation");
assert_equals(report.body.featureId, "network-efficiency-guardrails");
assert_equals(report.body.disposition, "enforce");
assert_equals(report.body.sourceFile, resourceUrl);
};
promise_test(async t => {
const report = new Promise(resolve => {
new ReportingObserver((reports, observer) => resolve([reports, observer]),
{ types: ['document-policy-violation'], buffered: false }).observe();
});
let response = await fetch('./resources/compressed.json');
document.getElementById('monitor').value = await response.text();
check_report_format(await report, response.url);
}, "NetworkEfficiencyGuardrails json compression");
});
</script>
<h1>Network Efficiency Guardrails</h1>
<textarea id="monitor" rows="5" cols="80" readonly></textarea>
</body>
</html>