Test IndexedDB's clearing an object store 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 = "clear.html" indexedDB.deleteDatabase(dbname) indexedDB.open(dbname) objectStore = db.createObjectStore('foo', { autoIncrement: true }); request = objectStore.add({}); Expecting exception from db.transaction('foo').objectStore('foo').clear(); PASS Exception was thrown. PASS code is 0 PASS ename is 'ReadOnlyError' db.transaction('foo', 'readwrite') transaction.objectStore('foo').clear(); request = db.transaction('foo').objectStore('foo').openCursor(); cursor = request.result; PASS cursor is null PASS successfullyParsed is true TEST COMPLETE