OLD | NEW |
1 Call db.close() in the complete handler for a version change transaction, before
the success event associated with the open call fires | 1 Call db.close() in the complete handler for a version change transaction, before
the success event associated with the open call fires |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | |
7 | |
8 dbname = "intversion-close-in-oncomplete.html" | 6 dbname = "intversion-close-in-oncomplete.html" |
9 indexedDB.deleteDatabase(dbname) | 7 indexedDB.deleteDatabase(dbname) |
10 request = indexedDB.open(dbname, 7) | 8 request = indexedDB.open(dbname, 7) |
11 | 9 |
12 upgradeNeeded(): | 10 upgradeNeeded(): |
13 db = event.target.result | 11 db = event.target.result |
14 PASS event.newVersion is 7 | 12 PASS event.newVersion is 7 |
15 db.createObjectStore('os') | 13 db.createObjectStore('os') |
16 transaction = event.target.transaction | 14 transaction = event.target.transaction |
17 | 15 |
18 transaction.oncomplete: | 16 transaction.oncomplete: |
19 sawTransactionComplete = true | 17 sawTransactionComplete = true |
20 db.close() | 18 db.close() |
21 | 19 |
22 openError(): | 20 openError(): |
23 PASS sawTransactionComplete is true | 21 PASS sawTransactionComplete is true |
24 PASS event.target.result is undefined. | 22 PASS event.target.result is undefined. |
25 PASS event.target.error is non-null. | 23 PASS event.target.error is non-null. |
26 PASS event.target.error.name is "AbortError" | 24 PASS event.target.error.name is "AbortError" |
27 Expecting exception from transaction = db.transaction('os', 'readwrite') | 25 Expecting exception from transaction = db.transaction('os', 'readwrite') |
28 PASS Exception was thrown. | 26 PASS Exception was thrown. |
29 PASS code is DOMException.INVALID_STATE_ERR | 27 PASS code is DOMException.INVALID_STATE_ERR |
30 PASS ename is 'InvalidStateError' | 28 PASS ename is 'InvalidStateError' |
31 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The databas
e connection is closing. | 29 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The databas
e connection is closing. |
32 PASS successfullyParsed is true | 30 PASS successfullyParsed is true |
33 | 31 |
34 TEST COMPLETE | 32 TEST COMPLETE |
35 | 33 |
OLD | NEW |