blob: 561153ac137ff90e6b7b3361e13525314ebdbaa0 [file] [log] [blame]
Test IndexedDB's read/write transactions
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(osName, { autoIncrement: true });
request = db.transaction([osName], 'readwrite').objectStore(osName).add({});
PASS event.target.transaction.mode is 'readwrite'
key1 = event.target.result;
request = db.transaction(osName, 'readwrite').objectStore(osName).add({});
PASS event.target.transaction.mode is 'readwrite'
key2 = event.target.result;
request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);
PASS event.target.transaction.mode is 'readwrite'
request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key2);
PASS event.target.transaction.mode is 'readwrite'
request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);
PASS event.target.transaction.mode is 'readwrite'
request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key1);
PASS event.target.transaction.mode is 'readwrite'
request = db.transaction([osName], 'readwrite').objectStore(osName).delete(key1);
PASS event.target.transaction.mode is 'readwrite'
request = db.transaction(osName, 'readwrite').objectStore(osName).delete(key2);
PASS event.target.transaction.mode is 'readwrite'
PASS successfullyParsed is true
TEST COMPLETE