95 lines
4.1 KiB
Plaintext
95 lines
4.1 KiB
Plaintext
Test IndexedDB invalid keys
|
|
|
|
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)
|
|
db.createObjectStore('foo');
|
|
Expecting exception from request = objectStore.put('value', void 0)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
|
|
Expecting exception from request = objectStore.put('value', null)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', (function() { return arguments; }()))
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', true)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', false)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', new Error)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', function () {})
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', JSON)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', Math)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', NaN)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', new Date(NaN))
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', {})
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', /regex/)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', self)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', self.document)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
Expecting exception from request = objectStore.put('value', self.document.body)
|
|
PASS Exception was thrown.
|
|
PASS code is 0
|
|
PASS ename is 'DataError'
|
|
Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|