tor-browser

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

script-src-spv-asynch.any.js (559B)


      1 // META: global=window,worker
      2 let code = new Uint8Array([0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0]);
      3 async_test(t => {
      4  self.addEventListener('securitypolicyviolation', t.step_func_done(e => {
      5    assert_equals(e.violatedDirective, "script-src");
      6    assert_equals(e.originalPolicy, "default-src 'self' 'unsafe-inline'")
      7    assert_equals(e.blockedURI, "wasm-eval")
      8  }));
      9 }, "Securitypolicyviolation event looks like it should");
     10 
     11 promise_test(t => {
     12  return promise_rejects_js(
     13      t, WebAssembly.CompileError,
     14      WebAssembly.instantiate(code));
     15 });