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

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: 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 const finish = pin_transaction(store);
28
29 db.deleteObjectStore('s2');
30
31 setTimeout(t.step_func(() => {
32 assert_throws(
33 'InvalidStateError', () => { store2[method]('key'); },
34 '"has been deleted" check (InvalidStateError) should precede ' +
35 '"not active" check (TransactionInactiveError)');
36
37 finish();
38 t.done();
39 }), 0);
40 },
41 (t, db) => {},
42 `IDBObjectStore.${method} exception order: ` +
43 'InvalidStateError vs. TransactionInactiveError'
44 );
45
46 indexeddb_test(
47 (t, db) => {
48 const store = db.createObjectStore('s');
49 },
50 (t, db) => {
51 const tx = db.transaction('s');
52 const store = tx.objectStore('s');
53 const finish = pin_transaction(store);
54
55 setTimeout(t.step_func(() => {
56 assert_throws(
57 'TransactionInactiveError', () => { store[method]({}); },
58 '"not active" check (TransactionInactiveError) should precede ' +
59 'query check (DataError)');
60
61 finish();
62 t.done();
63 }), 0);
64 },
65 `IDBObjectStore.${method} exception order: ` +
66 'TransactionInactiveError vs. DataError'
67 );
68 });
69
70 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698