OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>IndexedDB: object store renaming support</title> | 2 <title>IndexedDB: object store 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-idbobjectstore-name"> | 4 href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-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 // Renames the 'books' store to 'renamed_books'. | 11 // Renames the 'books' store to 'renamed_books'. |
12 // | 12 // |
13 // Returns a promise that resolves to an IndexedDB database. The caller must | 13 // Returns a promise that resolves to an IndexedDB database. The caller must |
14 // close the database. | 14 // close the database. |
15 const renameBooksStore = (testCase) => { | 15 const renameBooksStore = (testCase) => { |
16 return migrateDatabase(testCase, 2, (database, transaction) => { | 16 return migrateDatabase(testCase, 2, (database, transaction) => { |
17 const store = transaction.objectStore('books'); | 17 const store = transaction.objectStore('books'); |
18 store.name = 'renamed_books'; | 18 store.name = 'renamed_books'; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 const store = transaction.objectStore(name); | 357 const store = transaction.objectStore(name); |
358 return checkStoreContents( | 358 return checkStoreContents( |
359 testCase, store, | 359 testCase, store, |
360 'Renaming an object store should not change its records').then( | 360 'Renaming an object store should not change its records').then( |
361 () => database.close()); | 361 () => database.close()); |
362 }); | 362 }); |
363 }, 'IndexedDB object store can be renamed to "' + escapedName + '"'); | 363 }, 'IndexedDB object store can be renamed to "' + escapedName + '"'); |
364 })(escapedName); | 364 })(escapedName); |
365 | 365 |
366 </script> | 366 </script> |
OLD | NEW |