Test that IndexedDB objects that have been deleted throw exceptions

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 = self.location.pathname
request = indexedDB.deleteDatabase(dbname)

openDatabase():
request = indexedDB.open(dbname)
connection = request.result
request = connection.setVersion('1')

deletedStore = connection.createObjectStore('deletedStore')
store = connection.createObjectStore('store')
deletedIndex = store.createIndex('deletedIndex', 'path')

connection.deleteObjectStore('deletedStore')
store.deleteIndex('deletedIndex')

Expecting exception from deletedStore.put(0, 0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.add(0, 0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.delete(0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.get(0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.clear()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.openCursor()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.createIndex('name', 'path')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.index('name')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.deleteIndex('name')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedStore.count()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'

Expecting exception from deletedIndex.openCursor()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedIndex.openKeyCursor()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedIndex.get(0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedIndex.getKey(0)
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Expecting exception from deletedIndex.count()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
PASS successfullyParsed is true

TEST COMPLETE

