| Test the order when there are pending setVersion, delete and open calls. |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB; |
| |
| dbname = "deletedatabase-delayed-by-versionchange.html" |
| indexedDB.deleteDatabase(dbname) |
| indexedDB.open(dbname) |
| |
| h1OpenSuccess(): |
| setVersionBlockedEventFired = false |
| versionChangeComplete = false |
| deleteDatabaseBlockedEventFired = false |
| deleteDatabaseComplete = false |
| h1 = event.target.result |
| Open h2: |
| indexedDB.open(dbname) |
| |
| h2OpenSuccess(): |
| Try to open h3: |
| indexedDB.open(dbname, 2) |
| indexedDB.deleteDatabase(dbname) |
| |
| h1OnVersionChange(): |
| PASS event.target.version is 1 |
| PASS event.oldVersion is 1 |
| PASS event.newVersion is 2 |
| |
| h2OnVersionChange(): |
| PASS event.target.version is 1 |
| PASS event.oldVersion is 1 |
| PASS event.newVersion is 2 |
| |
| h3Blocked(): |
| setVersionBlockedEventFired = true |
| Try to open h4: |
| indexedDB.open(dbname) |
| h2.close() |
| |
| h1SecondOnVersionChange(): |
| PASS event.target.version is 1 |
| PASS event.oldVersion is 1 |
| PASS event.newVersion is null |
| |
| deleteDatabaseOnBlocked(): |
| deleteDatabaseBlockedEventFired = true |
| h1.close() |
| |
| h3OnUpgradeneeded(): |
| |
| transactionOnComplete(): |
| versionChangeComplete = true |
| |
| h3OpenSuccess(): |
| h3.close() |
| |
| deleteDatabaseOnSuccess(): |
| deleteDatabaseComplete = true |
| |
| h4OpenSuccess(): |
| PASS setVersionBlockedEventFired is true |
| PASS versionChangeComplete is true |
| PASS deleteDatabaseBlockedEventFired is true |
| PASS deleteDatabaseComplete is true |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |