blob: 179107b13ce35999025a3a71583209d3b328eb89 [file] [log] [blame]
Regression test for http://crbug.com/108071
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)
objectStore = db.createObjectStore('store', {keyPath: 'id'})
resetObjectStore():
objectStore.clear()
objectStore.add({id: 0, name: "Alpha"})
objectStore.add({id: 1, name: "Bravo"})
objectStore.add({id: 2, name: "Charlie"})
objectStore.add({id: 3, name: "Delta"})
objectStore.add({id: 4, name: "Echo"})
iterateAndDeleteFirstElement():
trans = db.transaction(['store'], 'readwrite')
trans.objectStore('store').openCursor()
0: Alpha
trans.objectStore('store').delete(0)
1: Bravo
2: Charlie
3: Delta
4: Echo
resetObjectStore():
objectStore.clear()
objectStore.add({id: 0, name: "Alpha"})
objectStore.add({id: 1, name: "Bravo"})
objectStore.add({id: 2, name: "Charlie"})
objectStore.add({id: 3, name: "Delta"})
objectStore.add({id: 4, name: "Echo"})
prefetchAndAbort():
trans.objectStore('store').openCursor()
0: Alpha
1: Bravo
2: Charlie
3: Delta
trans.abort()
PASS Transaction aborted as expected
PASS successfullyParsed is true
TEST COMPLETE