| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>IndexedDB: IDBObjectStore clear() Exception Ordering</title> | |
| 3 <meta charset=utf-8> | |
| 4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-clear
"> | |
| 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) => { | |
| 12 const store = db.createObjectStore('s'); | |
| 13 const store2 = db.createObjectStore('s2'); | |
| 14 | |
| 15 db.deleteObjectStore('s2'); | |
| 16 | |
| 17 setTimeout(t.step_func(() => { | |
| 18 assert_throws( | |
| 19 'InvalidStateError', () => { store2.clear(); }, | |
| 20 '"has been deleted" check (InvalidStateError) should precede ' + | |
| 21 '"not active" check (TransactionInactiveError)'); | |
| 22 t.done(); | |
| 23 }), 0); | |
| 24 }, | |
| 25 (t, db) => {}, | |
| 26 'IDBObjectStore.clear exception order: ' + | |
| 27 'InvalidStateError vs. TransactionInactiveError' | |
| 28 ); | |
| 29 | |
| 30 indexeddb_test( | |
| 31 (t, db) => { | |
| 32 const store = db.createObjectStore('s'); | |
| 33 }, | |
| 34 (t, db) => { | |
| 35 const tx = db.transaction('s', 'readonly'); | |
| 36 const store = tx.objectStore('s'); | |
| 37 | |
| 38 setTimeout(t.step_func(() => { | |
| 39 assert_throws( | |
| 40 'TransactionInactiveError', () => { store.clear(); }, | |
| 41 '"not active" check (TransactionInactiveError) should precede ' + | |
| 42 '"read only" check (ReadOnlyError)'); | |
| 43 t.done(); | |
| 44 }), 0); | |
| 45 }, | |
| 46 | |
| 47 'IDBObjectStore.clear exception order: ' + | |
| 48 'TransactionInactiveError vs. ReadOnlyError' | |
| 49 ); | |
| 50 | |
| 51 </script> | |
| OLD | NEW |