tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

network-efficiency-guardrails-json.tentative.html (1266B)


      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?pipe=gzip">
      9 </head>
     10 
     11 <body>
     12  <script>
     13 document.addEventListener('DOMContentLoaded', () => {
     14  const check_report_format = ([reports, observer], resourceUrl) => {
     15    const report = reports[0];
     16    assert_equals(report.type, "document-policy-violation");
     17    assert_equals(report.body.featureId, "network-efficiency-guardrails");
     18    assert_equals(report.body.disposition, "enforce");
     19    assert_equals(report.body.sourceFile, resourceUrl);
     20  };
     21 
     22  promise_test(async t => {
     23    const report = new Promise(resolve => {
     24      new ReportingObserver((reports, observer) => resolve([reports, observer]),
     25        { types: ['document-policy-violation'], buffered: false }).observe();
     26    });
     27 
     28    let response = await fetch('./resources/compressed.json');
     29    document.getElementById('monitor').value = await response.text();
     30 
     31    check_report_format(await report, response.url);
     32  }, "NetworkEfficiencyGuardrails json compression");
     33 });
     34  </script>
     35  <h1>Network Efficiency Guardrails</h1>
     36  <textarea id="monitor" rows="5" cols="80" readonly></textarea>
     37 </body>
     38 
     39 </html>