Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /IndexedDB/idbdatabase-deleteObjectStore-exception-order.any.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbdatabase-deleteObjectStore-exception-order.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbdatabase-deleteObjectStore-exception-order.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbdatabase-deleteObjectStore-exception-order.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
// META: title=IndexedDB: IDBDatabase deleteObjectStore() Exception Ordering
// META: script=resources/support.js
'use strict';
indexeddb_test(
(t, db, txn) => {
db.createObjectStore('s');
txn.onabort = () => {
setTimeout(
t.step_func(() => {
assert_throws_dom(
'InvalidStateError', () => db.deleteObjectStore('s'),
'"running an upgrade transaction" check (InvalidStateError) ' +
'should precede "not active" check (TransactionInactiveError)');
t.done();
}),
0);
};
txn.abort();
},
(t, db) => {
t.assert_unreached('open should fail');
},
'IDBDatabase.deleteObjectStore exception order: ' +
'InvalidStateError vs. TransactionInactiveError',
{upgrade_will_abort: true});
indexeddb_test(
(t, db, txn) => {
txn.abort();
assert_throws_dom(
'TransactionInactiveError', () => db.deleteObjectStore('nope'),
'"not active" check (TransactionInactiveError) should precede ' +
'"name in database" check (NotFoundError)');
t.done();
},
(t, db) => {
t.assert_unreached('open should fail');
},
'IDBDatabase.deleteObjectStore exception order: ' +
'TransactionInactiveError vs. NotFoundError',
{upgrade_will_abort: true});