1 Test that a deleteDatabase called while handling an upgradeneeded event is queued and fires its events at the right time. The close() call to unblock the delete occurs in the open request's 'success' event handler.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "delete-in-upgradeneeded-close-in-open-success.html"
7 indexedDB.deleteDatabase(dbname)
10 request = indexedDB.open(dbname, 1)
12 upgradeNeededCallback():
13 PASS sawUpgradeNeeded is false
14 sawUpgradeNeeded = true
15 PASS event.oldVersion is 0
16 PASS event.newVersion is 1
17 db = event.target.result
18 request2 = indexedDB.deleteDatabase(dbname)
19 request2.onsuccess = deleteSuccessCallback
21 versionChangeCallback():
22 PASS event.oldVersion is 1
23 PASS event.newVersion is null
24 PASS sawOpenSuccess is false
25 sawVersionChange = true
26 Connection not closed at the end of 'versionchange', so 'blocked' should fire
29 PASS sawUpgradeNeeded is true
30 PASS sawVersionChange is true
32 db = event.target.result
34 Closing here is too late to prevent the in-flight 'blocked' event, but it does unblock the delete.
37 deleteBlockedCallback():
38 PASS sawVersionChange is true
39 PASS sawOpenSuccess is true
40 sawDeleteBlocked = true
42 deleteSuccessCallback():
43 PASS sawVersionChange is true
44 PASS sawDeleteBlocked is true
45 PASS successfullyParsed is true