2 <script src=
"../../resources/js-test.js"></script>
3 <script src=
"resources/shared.js"></script>
6 description("Ensure DataCloneError is consistently thrown by IndexedDB methods");
8 var NON_CLONEABLE
= self
;
13 indexedDB
.deleteDatabase(dbname
+ '1'),
14 indexedDB
.deleteDatabase(dbname
+ '2'),
15 indexedDB
.deleteDatabase(dbname
+ '3')
18 function doFirstOpen()
21 request
= evalAndLog("indexedDB.open(dbname + '1')");
22 request
.onupgradeneeded
= function onUpgradeNeeded(e
) {
25 evalAndExpectException("db.createObjectStore('store').put(NON_CLONEABLE, 0);", "25", "'DataCloneError'");
30 function doSecondOpen()
33 request
= evalAndLog("indexedDB.open(dbname + '2')");
34 request
.onupgradeneeded
= function onUpgradeNeeded(e
) {
37 evalAndExpectException("db.createObjectStore('store').put(NON_CLONEABLE, 0);", "25", "'DataCloneError'");
42 function doThirdOpen()
45 request
= evalAndLog("indexedDB.open(dbname + '3')");
46 request
.onupgradeneeded
= function onUpgradeNeeded(e
) {
49 evalAndExpectException("db.createObjectStore('store').put(NON_CLONEABLE, INVALID_KEY);", "25", "'DataCloneError'");