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

Side by Side Diff: third_party/WebKit/LayoutTests/storage/indexeddb/idbobjectstore-deleteIndex-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 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
19 setTimeout(t.step_func(() => {
20 assert_throws(
21 'InvalidStateError', () => { store.deleteIndex('i'); },
22 '"running an upgrade transaction" check (InvalidStateError) ' +
23 'should precede "not active" check (TransactionInactiveError)');
24 t.done();
25 }), 0);
26 },
27 'IDBObjectStore.deleteIndex exception order: ' +
28 'InvalidStateError #1 vs. TransactionInactiveError'
29 );
30
31 indexeddb_test(
32 (t, db) => {
33 const store = db.createObjectStore('s');
34 const index = store.createIndex('i', 'keyPath');
35
36 db.deleteObjectStore('s');
37
38 setTimeout(t.step_func(() => {
39 assert_throws(
40 'InvalidStateError', () => { store.deleteIndex('i'); },
41 '"deleted" check (InvalidStateError) ' +
42 'should precede "not active" check (TransactionInactiveError)');
43 t.done();
44 }), 0);
45 },
46 (t, db) => {},
47 'IDBObjectStore.deleteIndex exception order: ' +
48 'InvalidStateError #2 vs. TransactionInactiveError'
49 );
50
51 indexeddb_test(
52 (t, db) => {
53 const store = db.createObjectStore('s');
54
55 setTimeout(t.step_func(() => {
56 assert_throws(
57 'TransactionInactiveError', () => { store.deleteIndex('nope'); },
58 '"not active" check (TransactionInactiveError) should precede ' +
59 '"name in store" check (NotFoundError)');
60 t.done();
61 }), 0);
62 },
63 (t, db) => {},
64 'IDBObjectStore.deleteIndex exception order: ' +
65 'TransactionInactiveError vs. NotFoundError'
66 );
67
68 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698