OLD | NEW |
1 <!DOCTYPE html> | 1 <!doctype html> |
| 2 <meta charset="utf8"> |
2 <title>IndexedDB: index renaming error handling</title> | 3 <title>IndexedDB: index renaming error handling</title> |
3 <link rel="help" | 4 <link rel="help" |
4 href="https://w3c.github.io/IndexedDB/#dom-idbindex-name"> | 5 href="https://w3c.github.io/IndexedDB/#dom-idbindex-name"> |
5 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> | 6 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> |
6 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
7 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
8 <script src="support-promises.js"></script> | 9 <script src="support-promises.js"></script> |
9 <script> | 10 <script> |
| 11 'use strict'; |
10 | 12 |
11 promise_test(testCase => { | 13 promise_test(testCase => { |
12 return createDatabase(testCase, (database, transaction) => { | 14 return createDatabase(testCase, (database, transaction) => { |
13 createBooksStore(testCase, database); | 15 createBooksStore(testCase, database); |
14 }).then(database => { | 16 }).then(database => { |
15 database.close(); | 17 database.close(); |
16 }).then(() => migrateDatabase(testCase, 2, (database, transaction) => { | 18 }).then(() => migrateDatabase(testCase, 2, (database, transaction) => { |
17 const store = transaction.objectStore('books'); | 19 const store = transaction.objectStore('books'); |
18 const index = store.index('by_author'); | 20 const index = store.index('by_author'); |
19 store.deleteIndex('by_author'); | 21 store.deleteIndex('by_author'); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 "should not change the index's IDBObjectStore.indexNames"); | 123 "should not change the index's IDBObjectStore.indexNames"); |
122 const index = store.index('by_author'); | 124 const index = store.index('by_author'); |
123 return checkAuthorIndexContents( | 125 return checkAuthorIndexContents( |
124 testCase, index, | 126 testCase, index, |
125 'Committing a transaction with a failed rename attempt should ' + | 127 'Committing a transaction with a failed rename attempt should ' + |
126 "not change the index's contents").then(() => database.close()); | 128 "not change the index's contents").then(() => database.close()); |
127 }); | 129 }); |
128 }, 'IndexedDB index rename handles exceptions when stringifying names'); | 130 }, 'IndexedDB index rename handles exceptions when stringifying names'); |
129 | 131 |
130 </script> | 132 </script> |
OLD | NEW |