Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/storage/indexeddb/idbdatabase-createObjectStore-exception-order.html |
| diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/idbdatabase-createObjectStore-exception-order.html b/third_party/WebKit/LayoutTests/storage/indexeddb/idbdatabase-createObjectStore-exception-order.html |
| index 2c9236640a5f1cce7263a2fde3f2eb4395f0abc4..7af30b00ed4b6d15efe75ae349784c080acd4d79 100644 |
| --- a/third_party/WebKit/LayoutTests/storage/indexeddb/idbdatabase-createObjectStore-exception-order.html |
| +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/idbdatabase-createObjectStore-exception-order.html |
| @@ -1,23 +1,82 @@ |
| <!DOCTYPE html> |
| <title>IndexedDB: IDBDatabase createObjectStore() Exception Ordering</title> |
| +<meta charset=utf-8> |
| <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore"> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="resources/testharness-helpers.js"></script> |
| - |
| <script> |
| indexeddb_test( |
| - function(t, db) { |
| - db.createObjectStore('s'); |
| - assert_throws('SyntaxError', function() { |
| - db.createObjectStore('s', {keyPath: 'not a valid key path'}); |
| - }, '"Invalid keyath" check (SyntaxError) should precede ' + |
| - '"duplicate store name" check (ConstraintError)'); |
| - t.done(); |
| - }, |
| - function(t, db) {}, |
| - 'IDBDatabase.createObjectStore exception order: ConstraintError vs. SyntaxError' |
| + (t, db) => { |
| + db.createObjectStore('s'); |
| + }, |
| + (t, db) => { |
| + const tx = db.transaction('s'); |
| + const store = tx.objectStore('s'); |
| + const finish = pin_transaction(store); |
| + |
| + setTimeout(t.step_func(() => { |
|
pwnall
2016/10/14 07:57:04
This alternative seems easier to reason about:
in
jsbell
2016/10/17 19:42:03
Done, w/ slight tweaks.
|
| + assert_throws( |
| + 'InvalidStateError', () => { db.createObjectStore('s2'); }, |
| + '"running an upgrade transaction" check (InvalidStateError) ' + |
| + 'should precede "not active" check (TransactionInactiveError)'); |
| + |
| + finish(); |
| + t.done(); |
| + }), 0); |
| + }, |
| + 'IDBDatabase.createObjectStore exception order: ' + |
| + 'InvalidStateError vs. TransactionInactiveError' |
| +); |
| + |
| +indexeddb_test( |
| + (t, db) => { |
| + const store = db.createObjectStore('s'); |
| + const finish = pin_transaction(store); |
| + |
| + setTimeout(t.step_func(() => { |
| + assert_throws( |
|
pwnall
2016/10/14 07:57:04
Firefox Nightly 52.0a1 (2016-10-13) fails this che
jsbell
2016/10/17 19:42:03
Awesome investigation. Done, w/ slight tweaks.
|
| + 'TransactionInactiveError', |
| + () => { db.createObjectStore('s2', {keyPath: '-invalid-'}); }, |
| + '"not active" check (TransactionInactiveError) should precede ' + |
| + '"valid key path" check (SyntaxError)'); |
| + finish(); |
| + t.done(); |
| + }), 0); |
| + }, |
| + (t, db) => {}, |
| + 'IDBDatabase.createObjectStore exception order: ' + |
| + 'TransactionInactiveError vs. SyntaxError' |
| +); |
| + |
| +indexeddb_test( |
| + (t, db) => { |
| + db.createObjectStore('s'); |
| + assert_throws('SyntaxError', () => { |
| + db.createObjectStore('s', {keyPath: 'not a valid key path'}); |
| + }, '"Invalid keyath" check (SyntaxError) should precede ' + |
| + '"duplicate store name" check (ConstraintError)'); |
| + t.done(); |
| + }, |
| + (t, db) => {}, |
| + 'IDBDatabase.createObjectStore exception order: ' + |
| + 'SyntaxError vs. ConstraintError' |
| +); |
| + |
| +indexeddb_test( |
| + (t, db) => { |
| + db.createObjectStore('s'); |
| + assert_throws('ConstraintError', () => { |
| + db.createObjectStore('s', {autoIncrement: true, |
| + keyPath: ''}); |
| + }, '"already exists" check (ConstraintError) should precede ' + |
| + '"autoIncrement vs. keyPath" check (InvalidAccessError)'); |
| + t.done(); |
| + }, |
| + (t, db) => {}, |
| + 'IDBDatabase.createObjectStore exception order: ' + |
| + 'ConstraintError vs. InvalidAccessError' |
| ); |
| </script> |