blob: 5d4098eebade5c0569a2507cd258d8fafadd2a4a [file] [log] [blame]
Test IndexedDB persistence
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
request = indexedDB.open(dbname, 1)
db = request.result
PASS db is non-null.
PASS db.version is 1
PASS db.objectStoreNames.length is 0
db.createObjectStore('store1')
PASS db.objectStoreNames.length is 1
db.close()
request = indexedDB.open(dbname, 2)
db = request.result
PASS db is non-null.
PASS db.version is 2
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('store1') is true
db.createObjectStore('store2')
PASS db.objectStoreNames.length is 2
PASS db.objectStoreNames.contains('store1') is true
PASS db.objectStoreNames.contains('store2') is true
db.close()
request = indexedDB.open(dbname, 3)
db = request.result
PASS db is non-null.
PASS db.version is 3
PASS db.objectStoreNames.length is 2
PASS db.objectStoreNames.contains('store1') is true
PASS db.objectStoreNames.contains('store2') is true
db.deleteObjectStore('store1')
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('store1') is false
PASS db.objectStoreNames.contains('store2') is true
db.close()
request = indexedDB.open(dbname, 4)
db = request.result
PASS db is non-null.
PASS db.version is 4
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('store1') is false
PASS db.objectStoreNames.contains('store2') is true
db.deleteObjectStore('store2')
PASS db.objectStoreNames.length is 0
PASS db.objectStoreNames.contains('store1') is false
PASS db.objectStoreNames.contains('store2') is false
db.close()
request = indexedDB.open(dbname, 5)
db = request.result
PASS db is non-null.
PASS db.version is 5
PASS db.objectStoreNames.length is 0
PASS db.objectStoreNames.contains('store1') is false
PASS db.objectStoreNames.contains('store2') is false
db.close()
PASS successfullyParsed is true
TEST COMPLETE