blob: 07a60c87deead11b97af8364f60a96d7e3b953d6 [file] [log] [blame]
<!DOCTYPE html>
<title>IndexedDB: Attempting to serialize a SharedArrayBuffer should throw</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/testharness-helpers.js"></script>
<script>
if (window.SharedArrayBuffer) {
indexeddb_test(
(t, db) => {
db.createObjectStore('store');
},
(t, db) => {
const sab = new SharedArrayBuffer(256);
const tx = db.transaction('store', 'readwrite');
const store = tx.objectStore('store');
assert_throws("DataCloneError", () => {
store.put({sab: sab}, 'key');
});
t.done();
},
'Serializing SharedArrayBuffer throws DataClone error.');
} else {
done();
}
</script>