OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <meta charset="utf8"> | 2 <meta charset="utf8"> |
3 <title>IndexedDB: versionchange transaction lifecycle</title> | 3 <title>IndexedDB: versionchange transaction lifecycle</title> |
4 <!-- These tests cannot yet be upstreamed to WPT because they rely on microtask | 4 <!-- These tests cannot yet be upstreamed to WPT because they rely on microtask |
5 sequencing, which was not fully specified yet. --> | 5 sequencing, which was not fully specified yet. --> |
6 <link rel="help" | 6 <link rel="help" |
7 href="https://w3c.github.io/IndexedDB/#upgrade-transaction-steps"> | 7 href="https://w3c.github.io/IndexedDB/#upgrade-transaction-steps"> |
8 <link rel="help" | 8 <link rel="help" |
9 href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore"> | 9 href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore"> |
10 <link rel="help" | 10 <link rel="help" |
11 href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteobjectstore"> | 11 href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteobjectstore"> |
12 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> | 12 <link rel="author" href="pwnall@chromium.org" title="Victor Costan"> |
13 <script src="../../resources/testharness.js"></script> | 13 <script src="../../resources/testharness.js"></script> |
14 <script src="../../resources/testharnessreport.js"></script> | 14 <script src="../../resources/testharnessreport.js"></script> |
15 <script src="resources/support-promises.js"></script> | 15 <script src="resources/support-promises.js"></script> |
16 <script> | 16 <script> |
17 'use strict'; | 17 'use strict'; |
| 18 setup({allow_uncaught_exception: true}); |
18 | 19 |
19 promise_test(t => { | 20 promise_test(t => { |
20 return createDatabase(t, database => { | 21 return createDatabase(t, database => { |
21 createBooksStore(t, database); | 22 createBooksStore(t, database); |
22 }).then(database => { | 23 }).then(database => { |
23 database.close(); | 24 database.close(); |
24 }).then(() => migrateDatabase(t, 2, (database, transaction, request) => { | 25 }).then(() => migrateDatabase(t, 2, (database, transaction, request) => { |
25 let abortFired = false; | 26 let abortFired = false; |
26 const abortPromise = new Promise((resolve, reject) => { | 27 const abortPromise = new Promise((resolve, reject) => { |
27 transaction.addEventListener('abort', () => { | 28 transaction.addEventListener('abort', () => { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 'InvalidStateError', | 183 'InvalidStateError', |
183 () => { database.deleteObjectStore('books'); }, | 184 () => { database.deleteObjectStore('books'); }, |
184 'deleteObjectStore exception should reflect that the transaction ' + | 185 'deleteObjectStore exception should reflect that the transaction ' + |
185 'is no longer running'); | 186 'is no longer running'); |
186 }); | 187 }); |
187 })).then(database => { database.close(); }); | 188 })).then(database => { database.close(); }); |
188 }, 'in a promise microtask after the complete event is fired for a committed ' + | 189 }, 'in a promise microtask after the complete event is fired for a committed ' + |
189 'transaction'); | 190 'transaction'); |
190 | 191 |
191 </script> | 192 </script> |
OLD | NEW |