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>
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);
21 assert_throws_dom("DataCloneError", () => {
22 rq
= objStore
.put({sab
: sab
}, 'key');
24 assert_equals(rq
, undefined);