| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>IndexedDB: IDBDatabase deleteObjectStore() Exception Ordering</title> |
| 3 <meta charset=utf-8> |
| 4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteob
jectstore"> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="resources/testharness-helpers.js"></script> |
| 8 <script> |
| 9 |
| 10 indexeddb_test( |
| 11 (t, db, req) => { |
| 12 db.createObjectStore('s'); |
| 13 req.transaction.abort(); |
| 14 req.onerror = null; |
| 15 setTimeout(t.step_func(() => { |
| 16 assert_throws( |
| 17 'InvalidStateError', () => { db.deleteObjectStore('s'); }, |
| 18 '"running an upgrade transaction" check (InvalidStateError) ' + |
| 19 'should precede "not active" check (TransactionInactiveError)'); |
| 20 t.done(); |
| 21 }), 0); |
| 22 }, |
| 23 (t, db) => { t.assert_unreached('open should fail'); }, |
| 24 'IDBDatabase.deleteObjectStore exception order: ' + |
| 25 'InvalidStateError vs. TransactionInactiveError' |
| 26 ); |
| 27 |
| 28 indexeddb_test( |
| 29 (t, db, req) => { |
| 30 req.transaction.abort(); |
| 31 req.onerror = null; |
| 32 assert_throws( |
| 33 'TransactionInactiveError', () => { db.deleteObjectStore('nope'); }, |
| 34 '"not active" check (TransactionInactiveError) should precede ' + |
| 35 '"name in database" check (NotFoundError)'); |
| 36 t.done(); |
| 37 }, |
| 38 (t, db) => { t.assert_unreached('open should fail'); }, |
| 39 'IDBDatabase.deleteObjectStore exception order: ' + |
| 40 'TransactionInactiveError vs. NotFoundError' |
| 41 ); |
| 42 |
| 43 </script> |
| OLD | NEW |