1 Test that a database is recreated correctly when an open-with-version call is queued behind both a deleteDatabase and an open-with-version call
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "intversion-long-queue.html"
7 indexedDB.deleteDatabase(dbname)
11 db = event.target.result
14 connection1 = event.target.result
15 PASS db is connection1
16 connection1.onversionchange = connection1VersionChangeCallback
17 request = indexedDB.open(dbname, 2)
18 request.onsuccess = connection2Success
19 request.onupgradeneeded = connection2UpgradeNeeded
20 request.onblocked = connection2Blocked
22 connection1VersionChangeCallback():
23 PASS event.type is "versionchange"
24 PASS event.oldVersion is 1
25 PASS event.newVersion is 2
28 request = indexedDB.deleteDatabase(dbname)
29 request.onsuccess = deleteDatabaseSuccessCallback
30 request = indexedDB.open(dbname, 3)
31 request.onupgradeneeded = connection3UpgradeNeeded
32 request.onsuccess = connection3Success
35 connection2UpgradeNeeded():
36 PASS event.oldVersion is 1
37 PASS event.newVersion is 2
38 db = event.target.result
39 PASS db.objectStoreNames.length is 0
40 db.createObjectStore('some object store')
41 transaction = event.target.transaction
42 transaction.oncomplete = connection2TransactionComplete
44 connection2TransactionComplete():
48 connection2 = event.target.result
51 deleteDatabaseSuccessCallback():
52 PASS event.target.result is undefined.
53 PASS event.type is "success"
55 connection3UpgradeNeeded():
56 gotUpgradeNeededEvent = true
57 PASS event.newVersion is 3
58 PASS event.oldVersion is 0
61 PASS gotUpgradeNeededEvent is true
62 PASS event.target.result.objectStoreNames.length is 0
63 PASS successfullyParsed is true