blob: 0c3ead7d52758030a5c2ffc44eee4c6731d6cbb5 [file] [log] [blame]
beidson@apple.com422df6a2016-01-19 06:02:30 +00001Test IndexedDB IDBDatabase internal delete pending flag
2
3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
7
8indexedDB.deleteDatabase(dbname)
9indexedDB.open(dbname, 5)
10connection.createObjectStore('store')
11PASS connection.objectStoreNames.length is 1
12
13Issue a delete request against the database - should be blocked by the open connection:
14deleteRequest = indexedDB.deleteDatabase(dbname)
15state = 0
16
17Open a second connection - should be delayed:
18openRequest = indexedDB.open(dbname)
19
20connection received versionchange event - ignoring.
21PASS ++state is 1
22
23deleteRequest received blocked event.
24PASS ++state is 2
25connection.close()
26deleteRequest should now be unblocked.
27
28deleteRequest received success event.
29PASS ++state is 3
30openRequest should now be unblocked.
31
32PASS openRequest received success event.
33PASS ++state is 4
34connection2 = openRequest.result
35connection2 should reference a different database:
36PASS connection2.version == connection.version is false
37PASS connection2.objectStoreNames.length is 0
38
39PASS successfullyParsed is true
40
41TEST COMPLETE
42