OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>IndexedDB: aborting transactions reverts index metadata</title> | 2 <title>IndexedDB: aborting transactions reverts index metadata</title> |
3 <script src='../../resources/testharness.js'></script> | |
4 <link rel="help" href="https://w3c.github.io/IndexedDB/#abort-transaction"> | 3 <link rel="help" href="https://w3c.github.io/IndexedDB/#abort-transaction"> |
5 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> | 4 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> |
6 <script src='../../resources/testharnessreport.js'></script> | 5 <script src="/resources/testharness.js"></script> |
7 <script src='resources/rename-common.js'></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="support-promises.js"></script> |
8 <script> | 8 <script> |
9 | 9 |
10 promise_test(testCase => { | 10 promise_test(testCase => { |
11 let store = null, index = null; | 11 let store = null, index = null; |
12 return createDatabase(testCase, (database, transaction) => { | 12 return createDatabase(testCase, (database, transaction) => { |
13 createBooksStore(testCase, database); | 13 createBooksStore(testCase, database); |
14 }).then(database => { | 14 }).then(database => { |
15 database.close(); | 15 database.close(); |
16 }).then(() => migrateDatabase(testCase, 2, (database, transaction) => { | 16 }).then(() => migrateDatabase(testCase, 2, (database, transaction) => { |
17 store = createNotBooksStore(testCase, database); | 17 store = createNotBooksStore(testCase, database); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 'aborted'); | 267 'aborted'); |
268 assert_array_equals( | 268 assert_array_equals( |
269 store.indexNames, ['not_by_author', 'not_by_title'], | 269 store.indexNames, ['not_by_author', 'not_by_title'], |
270 'IDBObjectStore.indexNames should stop including the newly ' + | 270 'IDBObjectStore.indexNames should stop including the newly ' + |
271 'created index after the transaction is aborted'); | 271 'created index after the transaction is aborted'); |
272 }); | 272 }); |
273 }, 'Created+deleted indexes are still marked as deleted after their ' + | 273 }, 'Created+deleted indexes are still marked as deleted after their ' + |
274 'transaction aborts'); | 274 'transaction aborts'); |
275 | 275 |
276 </script> | 276 </script> |
OLD | NEW |