Backed out changeset 133181fbd1ef (bug 1878148) for causing xpc crashes @ mozilla...
[gecko.git] / testing / web-platform / tests / IndexedDB / serialize-sharedarraybuffer-throws.https.html
blob613ddfe99d81704defe853466107065011819a69
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) {
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.");
13 let open_rq = createdb(t);
14 open_rq.onupgradeneeded = function(e) {
15 let db = e.target.result;
16 let objStore = db.createObjectStore("test", { keyPath:"pKey" });
18 let sab = new SharedArrayBuffer(256);
20 let rq;
21 assert_throws_dom("DataCloneError", () => {
22 rq = objStore.put({sab: sab}, 'key');
23 });
24 assert_equals(rq, undefined);
25 t.done();
27 });
28 </script>