Modern IDB: Fire blocked events for upgrade requests that are blocked.
[WebKit-https.git] / LayoutTests / storage / indexeddb / modern / blocked-open-db-requests-expected.txt
1 Makes sure that an OpenDBRequest that would result in a version change is blocked because there are still open connections, it gets the blocked event. Also makes sure that request gets unblocked when the open connections close.
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
7
8 dbname = "blocked-open-db-requests.html"
9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname)
11 connection = event.target.result;
12 connection.onversionchange = firstVersionChange;
13 objectStore = connection.createObjectStore('testObjectStore');
14 First version change transaction complete
15 firstTransaction = connection.transaction('testObjectStore', 'readwrite');
16 objectStore = firstTransaction.objectStore('testObjectStore');
17 objectStorePutLoop();
18 secondRequest = indexedDB.open(dbname, 2);
19 secondRequest.onblocked = secondBlocked;
20 secondRequest.onupgradeneeded = secondUpgradeNeeded;
21 receivedVersionChange = true;
22 ++blockedCount
23 PASS blockedEvent.oldVersion is 1
24 PASS blockedEvent.newVersion is 2
25 PASS blockedEvent.target.readyState is 'pending'
26 2nd upgradeNeeded
27 PASS blockedCount is 1
28 PASS event.target.result.version is 2
29 event.target.result.close();
30 PASS successfullyParsed is true
31
32 TEST COMPLETE
33