| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>IndexedDB: IDBIndex query method Ordering</title> |
| 3 <meta charset=utf-8> |
| 4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-get"> |
| 5 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-getall"> |
| 6 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-getallkeys"
> |
| 7 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-count"> |
| 8 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-opencursor"
> |
| 9 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-openkeycurs
or"> |
| 10 <script src="../../resources/testharness.js"></script> |
| 11 <script src="../../resources/testharnessreport.js"></script> |
| 12 <script src="resources/testharness-helpers.js"></script> |
| 13 <script> |
| 14 |
| 15 ['get', |
| 16 'getAll', |
| 17 'getAllKeys', |
| 18 'count', |
| 19 'openCursor', |
| 20 'openKeyCursor' |
| 21 ].forEach(method => { |
| 22 |
| 23 indexeddb_test( |
| 24 (t, db) => { |
| 25 const store = db.createObjectStore('s'); |
| 26 const store2 = db.createObjectStore('s2'); |
| 27 const index = store2.createIndex('i', 'keyPath'); |
| 28 |
| 29 store2.deleteIndex('i'); |
| 30 |
| 31 setTimeout(t.step_func(() => { |
| 32 assert_throws( |
| 33 'InvalidStateError', () => { index[method]('key'); }, |
| 34 '"has been deleted" check (InvalidStateError) should precede ' + |
| 35 '"not active" check (TransactionInactiveError)'); |
| 36 t.done(); |
| 37 }), 0); |
| 38 }, |
| 39 (t, db) => {}, |
| 40 `IDBIndex.${method} exception order: ` + |
| 41 'InvalidStateError vs. TransactionInactiveError' |
| 42 ); |
| 43 |
| 44 indexeddb_test( |
| 45 (t, db) => { |
| 46 const store = db.createObjectStore('s'); |
| 47 const index = store.createIndex('i', 'keyPath'); |
| 48 }, |
| 49 (t, db) => { |
| 50 const tx = db.transaction('s'); |
| 51 const store = tx.objectStore('s'); |
| 52 const index = store.index('i'); |
| 53 |
| 54 setTimeout(t.step_func(() => { |
| 55 assert_throws( |
| 56 'TransactionInactiveError', () => { index[method]({}); }, |
| 57 '"not active" check (TransactionInactiveError) should precede ' + |
| 58 'query check (DataError)'); |
| 59 t.done(); |
| 60 }), 0); |
| 61 }, |
| 62 `IDBIndex.${method} exception order: ` + |
| 63 'TransactionInactiveError vs. DataError' |
| 64 ); |
| 65 }); |
| 66 |
| 67 </script> |
| OLD | NEW |