Test IndexedDB's create and removeObjectStore

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 = "create-and-remove-object-store.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
db.createObjectStore('tmp')
Expecting exception from db.createObjectStore('tmp')
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ConstraintError'
trans = db.transaction(['tmp'])
trans.objectStore('tmp').get(0)
PASS event.target.result is undefined.
Trying create
Expecting exception from db.createObjectStore("some os")
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Trying remove
Expecting exception from db.deleteObjectStore("some os")
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Trying create with store that already exists
Expecting exception from db.createObjectStore('tmp')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Trying remove with store that already exists
Expecting exception from db.deleteObjectStore('tmp')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
PASS successfullyParsed is true

TEST COMPLETE

