Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / indexeddb / intversion-long-queue-expected.txt
blob7bd2d7d758e4cda8454ec8604f079ad3d83c6ab3
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)
8 indexedDB.open(dbname)
10 prepareDatabase():
11 db = event.target.result
13 connection1Success():
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
27 connection2Blocked():
28 request = indexedDB.deleteDatabase(dbname)
29 request.onsuccess = deleteDatabaseSuccessCallback
30 request = indexedDB.open(dbname, 3)
31 request.onupgradeneeded = connection3UpgradeNeeded
32 request.onsuccess = connection3Success
33 connection1.close()
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():
45 PASS db.version is 2
47 connection2Success():
48 connection2 = event.target.result
49 connection2.close()
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
60 connection3Success():
61 PASS gotUpgradeNeededEvent is true
62 PASS event.target.result.objectStoreNames.length is 0
63 PASS successfullyParsed is true
65 TEST COMPLETE