| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!doctype html> |
| 2 <meta charset="utf8"> |
| 2 <title>IndexedDB: object store renaming error handling</title> | 3 <title>IndexedDB: object store renaming error handling</title> |
| 3 <link rel="help" | 4 <link rel="help" |
| 4 href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-name"> | 5 href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-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 database.deleteObjectStore('books'); | 20 database.deleteObjectStore('books'); |
| 19 assert_throws('InvalidStateError', () => store.name = 'renamed_books'); | 21 assert_throws('InvalidStateError', () => store.name = 'renamed_books'); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const transaction = database.transaction('books', 'readonly'); | 111 const transaction = database.transaction('books', 'readonly'); |
| 110 const store = transaction.objectStore('books'); | 112 const store = transaction.objectStore('books'); |
| 111 return checkStoreContents( | 113 return checkStoreContents( |
| 112 testCase, store, | 114 testCase, store, |
| 113 'Committing a transaction with a failed rename attempt should ' + | 115 'Committing a transaction with a failed rename attempt should ' + |
| 114 "not change the store's contents").then(() => database.close()); | 116 "not change the store's contents").then(() => database.close()); |
| 115 }); | 117 }); |
| 116 }, 'IndexedDB object store rename handles exceptions when stringifying names'); | 118 }, 'IndexedDB object store rename handles exceptions when stringifying names'); |
| 117 | 119 |
| 118 </script> | 120 </script> |
| OLD | NEW |