Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>IndexedDB: IDBObjectStore deleteIndex() Exception Ordering</title> | |
| 3 <meta charset=utf-8> | |
| 4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-delet eindex"> | |
| 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 store.createIndex('i', 'keyPath'); | |
| 14 }, | |
| 15 (t, db) => { | |
| 16 const tx = db.transaction('s'); | |
| 17 const store = tx.objectStore('s'); | |
| 18 const finish = pin_transaction(store); | |
| 19 | |
| 20 setTimeout(t.step_func(() => { | |
| 21 assert_throws( | |
| 22 'InvalidStateError', () => { store.deleteIndex('i'); }, | |
| 23 '"running an upgrade transaction" check (InvalidStateError) ' + | |
| 24 'should precede "not active" check (TransactionInactiveError)'); | |
| 25 | |
| 26 finish(); | |
| 27 t.done(); | |
| 28 }), 0); | |
| 29 }, | |
| 30 'IDBObjectStore.deleteIndex exception order: ' + | |
| 31 'InvalidStateError vs. TransactionInactiveError #1' | |
|
pwnall
2016/10/14 07:57:05
Should this be InvalidStateError #1 vs Transaction
jsbell
2016/10/17 19:42:04
Done.
| |
| 32 ); | |
| 33 | |
| 34 indexeddb_test( | |
| 35 (t, db) => { | |
| 36 const store = db.createObjectStore('s'); | |
| 37 const index = store.createIndex('i', 'keyPath'); | |
| 38 | |
| 39 const finish = pin_transaction(store); | |
| 40 | |
| 41 db.deleteObjectStore('s'); | |
| 42 | |
| 43 setTimeout(t.step_func(() => { | |
| 44 assert_throws( | |
| 45 'InvalidStateError', () => { store.deleteIndex('i'); }, | |
| 46 '"deleted" check (InvalidStateError) ' + | |
| 47 'should precede "not active" check (TransactionInactiveError)'); | |
| 48 | |
| 49 finish(); | |
| 50 t.done(); | |
| 51 }), 0); | |
| 52 }, | |
| 53 (t, db) => {}, | |
| 54 'IDBObjectStore.deleteIndex exception order: ' + | |
| 55 'InvalidStateError vs. TransactionInactiveError #2' | |
|
pwnall
2016/10/14 07:57:05
Should this be InvalidStateError #2 vs Transaction
jsbell
2016/10/17 19:42:03
Done.
| |
| 56 ); | |
| 57 | |
| 58 indexeddb_test( | |
| 59 (t, db) => { | |
| 60 const store = db.createObjectStore('s'); | |
| 61 const finish = pin_transaction(store); | |
| 62 | |
| 63 setTimeout(t.step_func(() => { | |
| 64 assert_throws( | |
| 65 'TransactionInactiveError', () => { store.deleteIndex('nope'); }, | |
| 66 '"not active" check (TransactionInactiveError) should precede ' + | |
| 67 '"name in store" check (NotFoundError)'); | |
| 68 finish(); | |
| 69 t.done(); | |
| 70 }), 0); | |
| 71 }, | |
| 72 (t, db) => {}, | |
| 73 'IDBObjectStore.deleteIndex exception order: ' + | |
| 74 'TransactionInactiveError vs. NotFoundError' | |
| 75 ); | |
| 76 | |
| 77 </script> | |
| OLD | NEW |