tor-browser

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

usb-report-only.https.html (982B)


      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  </head>
      9  <body>
     10    <div id='fs'></div>
     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, "usb");
     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 USB');
     25  await navigator.usb.getDevices();
     26  check_report_format(await report);
     27 }, "USB report only mode");
     28    </script>
     29  </body>
     30 </html>