1 Test that a database is recreated correctly when an open-with-version call is queued behind a deleteDatabase call
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "intversion-gated-on-delete.html"
7 indexedDB.deleteDatabase(dbname)
10 request = indexedDB.open(dbname)
11 request.onsuccess = firstSuccessCallback
13 firstSuccessCallback():
14 connection1 = event.target.result
15 connection1.onversionchange = connection1VersionChangeCallback
16 request = indexedDB.open(dbname)
17 request.onsuccess = secondSuccessCallback
18 request = indexedDB.deleteDatabase(dbname)
19 request.onblocked = deleteDatabaseBlockedCallback
20 request.onsuccess = deleteDatabaseSuccessCallback
21 request = indexedDB.open(dbname, 1)
22 request.onupgradeneeded = upgradeNeededCallback
23 request.onsuccess = openWithVersionSuccessCallback
25 secondSuccessCallback():
26 db = event.target.result
27 db.onversionchange = connection2VersionChangeCallback
29 connection1VersionChangeCallback():
30 PASS event.type is "versionchange"
31 PASS event.oldVersion is 1
32 PASS event.newVersion is null
34 connection2VersionChangeCallback():
35 PASS event.type is "versionchange"
38 deleteDatabaseBlockedCallback():
41 deleteDatabaseSuccessCallback():
43 upgradeNeededCallback():
44 PASS event.newVersion is 1
45 PASS event.oldVersion is 0
47 openWithVersionSuccessCallback():
48 PASS event.target.result.objectStoreNames.length is 0
49 PASS successfullyParsed is true