OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>IndexedDB: index renaming support</title> | 2 <title>IndexedDB: index renaming support</title> |
3 <script src='../../resources/testharness.js'></script> | |
4 <link rel="help" | 3 <link rel="help" |
5 href="https://w3c.github.io/IndexedDB/#dom-idbindex-name"> | 4 href="https://w3c.github.io/IndexedDB/#dom-idbindex-name"> |
6 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> | 5 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> |
7 <script src='../../resources/testharnessreport.js'></script> | 6 <script src="/resources/testharness.js"></script> |
8 <script src='resources/rename-common.js'></script> | 7 <script src="/resources/testharnessreport.js"></script> |
| 8 <script src="support-promises.js"></script> |
9 <script> | 9 <script> |
10 | 10 |
11 promise_test(testCase => { | 11 promise_test(testCase => { |
12 let authorIndex = null, authorIndex2 = null; | 12 let authorIndex = null, authorIndex2 = null; |
13 let renamedAuthorIndex = null, renamedAuthorIndex2 = null; | 13 let renamedAuthorIndex = null, renamedAuthorIndex2 = null; |
14 return createDatabase(testCase, (database, transaction) => { | 14 return createDatabase(testCase, (database, transaction) => { |
15 const store = createBooksStore(testCase, database); | 15 const store = createBooksStore(testCase, database); |
16 authorIndex = store.index('by_author'); | 16 authorIndex = store.index('by_author'); |
17 }).then(database => { | 17 }).then(database => { |
18 const transaction = database.transaction('books', 'readonly'); | 18 const transaction = database.transaction('books', 'readonly'); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 const index = store.index(name); | 289 const index = store.index(name); |
290 return checkAuthorIndexContents( | 290 return checkAuthorIndexContents( |
291 testCase, index, | 291 testCase, index, |
292 'Renaming an index should not change its contents').then( | 292 'Renaming an index should not change its contents').then( |
293 () => database.close()); | 293 () => database.close()); |
294 }); | 294 }); |
295 }, 'IndexedDB index can be renamed to "' + escapedName + '"'); | 295 }, 'IndexedDB index can be renamed to "' + escapedName + '"'); |
296 })(escapedName); | 296 })(escapedName); |
297 | 297 |
298 </script> | 298 </script> |
OLD | NEW |