Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: third_party/WebKit/LayoutTests/storage/indexeddb/idbobjectstore-query-exception-order.html

Issue 2415203002: Indexed DB: More exception precedence tests (Closed)
Patch Set: Review feedback - no more tx pinning, tweaked store create/delete tests to satisfy FF Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>IndexedDB: IDBObjectStore query method Ordering</title>
3 <meta charset=utf-8>
4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-get">
5 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getal l">
6 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getal lkeys">
7 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-count ">
8 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-openc ursor">
9 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-openk eycursor">
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
28 db.deleteObjectStore('s2');
29
30 setTimeout(t.step_func(() => {
31 assert_throws(
32 'InvalidStateError', () => { store2[method]('key'); },
33 '"has been deleted" check (InvalidStateError) should precede ' +
34 '"not active" check (TransactionInactiveError)');
35
36 t.done();
37 }), 0);
38 },
39 (t, db) => {},
40 `IDBObjectStore.${method} exception order: ` +
41 'InvalidStateError vs. TransactionInactiveError'
42 );
43
44 indexeddb_test(
45 (t, db) => {
46 const store = db.createObjectStore('s');
47 },
48 (t, db) => {
49 const tx = db.transaction('s');
50 const store = tx.objectStore('s');
51
52 setTimeout(t.step_func(() => {
53 assert_throws(
54 'TransactionInactiveError', () => { store[method]({}); },
55 '"not active" check (TransactionInactiveError) should precede ' +
56 'query check (DataError)');
57 t.done();
58 }), 0);
59 },
60 `IDBObjectStore.${method} exception order: ` +
61 'TransactionInactiveError vs. DataError'
62 );
63 });
64
65 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698