blob: 50180d4ef6d9c151fb0cca4b98dcdf383f5db38c [file] [log] [blame]
Test IndexedDB's webkitIDBObjectStore.clear().
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)
store = db.createObjectStore('storeName', null)
store.createIndex('indexName', '')
PASS store.indexNames.contains('indexName') is true
store.add('value', 'key')
otherStore = db.createObjectStore('otherStoreName', null)
otherStore.add('value', 'key')
store.clear()
PASS event.target.result is undefined.
store.openCursor()
PASS event.target.result is null
index = store.index('indexName')
index.openKeyCursor()
openKeyCursorSuccess():
PASS event.target.result is null
db.transaction(['otherStoreName'])
otherStore = transaction.objectStore('otherStoreName')
otherStore.get('key')
PASS event.target.result is "value"
PASS successfullyParsed is true
TEST COMPLETE