tor-browser

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

compute-pressure-disabled-by-permissions-policy-worker.js (481B)


      1 'use strict';
      2 
      3 importScripts('/resources/testharness.js');
      4 
      5 const header = 'Permissions-Policy header compute-pressure=()';
      6 let workerType;
      7 
      8 if (typeof postMessage === 'function') {
      9  workerType = 'dedicated';
     10 }
     11 
     12 promise_test(async t => {
     13  const observer =
     14      new PressureObserver(t.unreached_func('oops should not end up here'));
     15  await promise_rejects_dom(t, 'NotAllowedError', observer.observe('cpu'));
     16 }, `$Inherited ${header} disallows ${workerType} workers.`);
     17 
     18 done();