tor-browser

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

serialize-sharedarraybuffer-throws.https.html (920B)


      1 <!DOCTYPE html>
      2 <title>IndexedDB: Attempting to serialize a SharedArrayBuffer should throw</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="resources/support.js"></script>
      6 <script>
      7  async_test(function(t) {
      8 
      9    // The SAB constructor throws if the page is not cross-origin-isolated.
     10    assert_true(self.crossOriginIsolated,
     11                "The page is served with COOP and COEP, it should be cross-origin-isolated.");
     12 
     13    let open_rq = createdb(t);
     14    open_rq.onupgradeneeded = function(e) {
     15        let db = e.target.result;
     16        let objStore = db.createObjectStore("test");
     17 
     18        let sab = new SharedArrayBuffer(256);
     19 
     20        let rq;
     21        assert_throws_dom("DataCloneError", () => {
     22            rq = objStore.put({sab: sab}, 'key');
     23        });
     24        assert_equals(rq, undefined);
     25        t.done();
     26    };
     27  });
     28 </script>