tor-browser

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

camera-report-only.https.html (1122B)


      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  </head>
     10  <body>
     11    <script>
     12 var check_report_format = ([reports, observer]) => {
     13  let report = reports[0];
     14  assert_equals(report.type, "permissions-policy-violation");
     15  assert_equals(report.body.featureId, "camera");
     16  assert_equals(report.body.disposition, "report");
     17 };
     18 
     19 promise_test(async t => {
     20  const report = new Promise(resolve => {
     21    new ReportingObserver((reports, observer) => resolve([reports, observer]),
     22                          {types: ['permissions-policy-violation']}).observe();
     23  });
     24  await test_driver.bless('Activate document for user media');
     25  await setMediaPermission("granted", ["camera"]);
     26  await navigator.mediaDevices.getUserMedia({video: true});
     27  check_report_format(await report);
     28 }, "Camera report only mode");
     29    </script>
     30  </body>
     31 </html>