blob: 33f55f24b3a6d1391bc53363cb0c91c8b051d1e4 [file] [log] [blame]
Test IndexedDB deleting an object store
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)
PASS db.objectStoreNames.length is 0
objectStoreName = 'Objects';
objectStore = db.createObjectStore(objectStoreName, { keyPath: 'foo' });
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
request = objectStore.add({foo: i});
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.item(0) is objectStoreName
db.close()
request = indexedDB.open(dbname, 2)
db.deleteObjectStore(objectStore.name);
PASS db.objectStoreNames.length is 0
objectStore = db.createObjectStore(objectStoreName, { keyPath: 'foo' });
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.item(0) is objectStoreName
request = objectStore.openCursor();
PASS event.target.result is null
db.deleteObjectStore(objectStore.name);
PASS db.objectStoreNames.length is 0
db.close()
request = indexedDB.open(dbname, 3)
objectStore = db.createObjectStore(objectStoreName, { keyPath: 'foo' });
request = objectStore.add({foo:'bar'});
db.deleteObjectStore(objectStoreName);
PASS successfullyParsed is true
TEST COMPLETE