tor-browser

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

reuse-wasm-loaded-as-classic-script.tentative.html (1208B)


      1 <!doctype html>
      2 <title>Reuse Wasm loaded as classic script</title>
      3 
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <script>
      8  'use strict';
      9  setup({allow_uncaught_exception: true});
     10  promise_test(t => {
     11    return new Promise((resolve, reject) => {
     12      window.addEventListener('test_finished', resolve);
     13    });
     14  });
     15 </script>
     16 
     17 <!-- This should throw, but browsers should be able to handle the subsequent
     18 module import properly.
     19 
     20 This test is for Chromium https://crbug.com/425682456 while other browsers
     21 should also pass the test. The crossorigin attribute is added to make
     22 Chromium's Blink MemoryCache to use the same underlying Resource for the
     23 classic script here and as the Wasm module below. -->
     24 <script crossorigin src="./resources/exported-names.wasm"></script>
     25 
     26 <script type=module>
     27 import source exportedNamesSource from "./resources/exported-names.wasm";
     28 assert_true(exportedNamesSource instanceof WebAssembly.Module);
     29 assert_array_equals(WebAssembly.Module.exports(exportedNamesSource).map(({ name }) => name).sort(),
     30                    ["func", "glob", "mem", "tab"]);
     31 window.dispatchEvent(new Event('test_finished'));
     32 </script>