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