1 Test IndexedDB persistence
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "persistence.html"
7 indexedDB.deleteDatabase(dbname)
10 request = indexedDB.open(dbname, 1)
14 PASS db.name is "persistence.html"
15 PASS db.objectStoreNames.length is 0
16 db.createObjectStore('store1')
17 PASS db.objectStoreNames.length is 1
20 request = indexedDB.open(dbname, 2)
24 PASS db.name is "persistence.html"
25 PASS db.objectStoreNames.length is 1
26 PASS db.objectStoreNames.contains('store1') is true
27 db.createObjectStore('store2')
28 PASS db.objectStoreNames.length is 2
29 PASS db.objectStoreNames.contains('store1') is true
30 PASS db.objectStoreNames.contains('store2') is true
33 request = indexedDB.open(dbname, 3)
37 PASS db.name is "persistence.html"
38 PASS db.objectStoreNames.length is 2
39 PASS db.objectStoreNames.contains('store1') is true
40 PASS db.objectStoreNames.contains('store2') is true
41 db.deleteObjectStore('store1')
42 PASS db.objectStoreNames.length is 1
43 PASS db.objectStoreNames.contains('store1') is false
44 PASS db.objectStoreNames.contains('store2') is true
47 request = indexedDB.open(dbname, 4)
51 PASS db.name is "persistence.html"
52 PASS db.objectStoreNames.length is 1
53 PASS db.objectStoreNames.contains('store1') is false
54 PASS db.objectStoreNames.contains('store2') is true
55 db.deleteObjectStore('store2')
56 PASS db.objectStoreNames.length is 0
57 PASS db.objectStoreNames.contains('store1') is false
58 PASS db.objectStoreNames.contains('store2') is false
61 request = indexedDB.open(dbname, 5)
65 PASS db.name is "persistence.html"
66 PASS db.objectStoreNames.length is 0
67 PASS db.objectStoreNames.contains('store1') is false
68 PASS db.objectStoreNames.contains('store2') is false
70 PASS successfullyParsed is true