blob: edd4b3caaa40f8d3bf5124ad187e87d7836797ae [file] [log] [blame]
This test creates some object stores, putting some values in them, committing the transaction. In a new transaction, it then overwrites those values, but then aborts the transaction. Finally it verifies everything is set up from the first transaction, and nothing from the aborted one committed.
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)
First upgrade needed: Old version - 0 New version - 1
[object IDBTransaction] - versionchange
[object IDBDatabase]
put succeeded - key was 'foo'
get 'foo' succeeded - value was 'bar'
get 'far' succeeded - value was 'undefined'
First version change transaction completed
Second upgrade needed: Old version - 1 New version - 2
[object IDBTransaction] - versionchange
[object IDBDatabase]
get1 'foo' succeeded - value was 'baz'
get2 'far' succeeded - value was 'boo'
Second version change transaction abort
Third upgrade needed: Old version - 1 New version - 2
[object IDBTransaction] - versionchange
[object IDBDatabase]
get1 'foo' succeeded - value was 'bar'
get2 'far' succeeded - value was 'undefined'
Third version change transaction complete
PASS successfullyParsed is true
TEST COMPLETE