tor-browser

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

report-only-single-endpoint.https.sub.html (1193B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <script src='/resources/testharness.js'></script>
      5    <script src='/resources/testharnessreport.js'></script>
      6    <script src='/resources/testdriver.js'></script>
      7    <script src='/resources/testdriver-vendor.js'></script>
      8    <script src='../../mediacapture-streams/permission-helper.js'></script>
      9    <script src='/reporting/resources/report-helper.js'></script>
     10  </head>
     11  <body>
     12    <script>
     13  const base_url = `${location.protocol}//${location.host}`;
     14  const endpoint = `${base_url}/reporting/resources/report.py`;
     15  const id = 'c3841a1a-e750-4801-a50b-c4222d386515';
     16 
     17  promise_test(async t => {
     18    await setMediaPermission("granted", ["camera","microphone"]);
     19    // This should not throw, as the enforcing policy does not block it.
     20    await navigator.mediaDevices.getUserMedia({video: true});
     21    while(true) {
     22      await wait(100);
     23      const reports = await pollReports(endpoint, id);
     24      if (reports.length) {
     25        checkReportExists(reports, 'permissions-policy-violation', location.href);
     26        break;
     27      }
     28    }
     29  }, "Reporting-Endpoints defined endpoint received reports in report-only mode.");
     30    </script>
     31  </body>
     32 </html>