Test IndexedDB transaction basics. 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; dbname = "transaction-basics.html" indexedDB.deleteDatabase(dbname) indexedDB.open(dbname) PASS self.db.objectStoreNames is [] PASS self.db.objectStoreNames.length is 0 PASS self.db.objectStoreNames.contains('storeFail') is false request = newConnection() indexedDB.open(dbname, 2) addRemoveIDBObjects(): trans = event.target.transaction PASS trans is non-null. store = db.createObjectStore('storeFail', null) index = store.createIndex('indexFail', 'x') db.deleteObjectStore('storeFail') Expecting exception from store.deleteIndex('indexFail') PASS Exception was thrown. PASS code is DOMException.INVALID_STATE_ERR PASS ename is 'InvalidStateError' testSetVersionAbort2(): PASS self.db.objectStoreNames is [] PASS self.db.objectStoreNames.length is 0 PASS self.db.objectStoreNames.contains('storeFail') is false request = newConnection() indexedDB.open(dbname, 3) addRemoveAddIDBObjects(): trans = event.target.transaction PASS trans is non-null. store = db.createObjectStore('storeFail', null) index = store.createIndex('indexFail', 'x') db.deleteObjectStore('storeFail') Expecting exception from store.deleteIndex('indexFail') PASS Exception was thrown. PASS code is DOMException.INVALID_STATE_ERR PASS ename is 'InvalidStateError' store = db.createObjectStore('storeFail', null) index = store.createIndex('indexFail', 'x') testSetVersionAbort3(): PASS event.cancelable is false PASS self.db.objectStoreNames is [] PASS self.db.objectStoreNames.length is 0 PASS self.db.objectStoreNames.contains('storeFail') is false request = newConnection() indexedDB.open(dbname, 4) addIDBObjects(): PASS event.cancelable is false trans = event.target.transaction PASS trans is non-null. store = db.createObjectStore('storeFail', null) index = store.createIndex('indexFail', 'x') testInactiveAbortedTransaction(): Expecting exception from index.openCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.openKeyCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.get(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.getKey(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.count() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.put(0, 0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.add(0, 0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.delete(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.clear() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.get(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.openCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' testSetVersionAbort4(): PASS self.db.objectStoreNames is [] PASS self.db.objectStoreNames.length is 0 PASS self.db.objectStoreNames.contains('storeFail') is false request = newConnection() indexedDB.open(dbname, 5) addIDBObjectsAndCommit(): trans = event.target.transaction PASS trans is non-null. store = db.createObjectStore('storeFail', null) index = store.createIndex('indexFail', 'x') testInactiveCompletedTransaction(): Expecting exception from index.openCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.openKeyCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.get(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.getKey(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from index.count() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.put(0, 0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.add(0, 0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.delete(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.clear() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.get(0) PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Expecting exception from store.openCursor() PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' testSetVersionAbort5(): PASS db.objectStoreNames is ['storeFail'] PASS db.objectStoreNames.length is 1 PASS db.objectStoreNames.contains('storeFail') is true request = newConnection() indexedDB.open(dbname, 6) removeIDBObjects(): trans = event.target.transaction PASS trans is non-null. store = trans.objectStore('storeFail') store.deleteIndex('indexFail') db.deleteObjectStore('storeFail') testSetVersionAbort6(): PASS db.objectStoreNames is ['storeFail'] PASS db.objectStoreNames.length is 1 PASS db.objectStoreNames.contains('storeFail') is true request = newConnection() indexedDB.open(dbname, 7) setVersionSuccess(): trans = event.target.transaction PASS trans is non-null. Deleted all object stores. db.createObjectStore('storeName', null) completeCallback(): PASS event.cancelable is false PASS complete event fired db.transaction(['storeName']) store = transaction.objectStore('storeName') PASS store.name is "storeName" PASS complete event fired Verifying DOMStringList works as argument for IDBDatabase.transaction() db.objectStoreNames is [object DOMStringList] ... which contains: ["storeName"] transaction = db.transaction(db.objectStoreNames) PASS no exception thrown PASS transaction.objectStore("storeName") is non-null. PASS all stores present in transaction Verify that specifying an invalid mode raises an exception Expecting TypeError exception from db.transaction(['storeName'], 'lsakjdf') PASS Exception was thrown. PASS db.transaction(['storeName'], 'lsakjdf') threw TypeError: Type error Test that null and undefined are treated as strings Expecting exception from db.transaction(null) PASS Exception was thrown. PASS code is DOMException.NOT_FOUND_ERR PASS ename is 'NotFoundError' Expecting exception from db.transaction(undefined) PASS Exception was thrown. PASS code is DOMException.NOT_FOUND_ERR PASS ename is 'NotFoundError' request = newConnection() indexedDB.open(dbname, 8) db.createObjectStore('null') db.createObjectStore('undefined') PASS transaction = db.transaction(null) did not throw exception. PASS transaction.objectStore('null') is non-null. PASS transaction = db.transaction(undefined) did not throw exception. PASS transaction.objectStore('undefined') is non-null. PASS successfullyParsed is true TEST COMPLETE