network-efficiency-guardrails.tentative.html (954B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <script src='/resources/testharness.js'></script> 6 <script src='/resources/testharnessreport.js'></script> 7 8 <link rel="stylesheet" href="./resources/compressed.css"> 9 </head> 10 11 <body> 12 <script> 13 const check_report_format = ([reports, observer]) => { 14 const report = reports[0]; 15 assert_equals(report.type, "document-policy-violation"); 16 assert_equals(report.body.featureId, "network-efficiency-guardrails"); 17 assert_equals(report.body.disposition, "enforce"); 18 assert_equals(report.body.sourceFile, document.styleSheets[0].href); 19 }; 20 21 promise_test(async t => { 22 const report = new Promise(resolve => { 23 new ReportingObserver((reports, observer) => resolve([reports, observer]), 24 { types: ['document-policy-violation'], buffered: true }).observe(); 25 }); 26 check_report_format(await report); 27 }, "NetworkEfficiencyGuardrails compression"); 28 </script> 29 <h1>Network Efficiency Guardrails</h1> 30 </body> 31 32 </html>