1 Test IndexedDB invalid keys
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "invalid-keys.html"
7 indexedDB.deleteDatabase(dbname)
9 db.createObjectStore('foo');
10 Expecting exception from request = objectStore.put('value', void 0)
11 PASS Exception was thrown.
13 PASS ename is 'DataError'
14 Exception message: Failed to execute 'put' on 'IDBObjectStore': The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
15 Expecting exception from request = objectStore.put('value', null)
16 PASS Exception was thrown.
18 PASS ename is 'DataError'
19 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
20 Expecting exception from request = objectStore.put('value', (function() { return arguments; }()))
21 PASS Exception was thrown.
23 PASS ename is 'DataError'
24 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
25 Expecting exception from request = objectStore.put('value', true)
26 PASS Exception was thrown.
28 PASS ename is 'DataError'
29 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
30 Expecting exception from request = objectStore.put('value', false)
31 PASS Exception was thrown.
33 PASS ename is 'DataError'
34 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
35 Expecting exception from request = objectStore.put('value', new Error)
36 PASS Exception was thrown.
38 PASS ename is 'DataError'
39 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
40 Expecting exception from request = objectStore.put('value', function () {})
41 PASS Exception was thrown.
43 PASS ename is 'DataError'
44 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
45 Expecting exception from request = objectStore.put('value', JSON)
46 PASS Exception was thrown.
48 PASS ename is 'DataError'
49 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
50 Expecting exception from request = objectStore.put('value', Math)
51 PASS Exception was thrown.
53 PASS ename is 'DataError'
54 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
55 Expecting exception from request = objectStore.put('value', NaN)
56 PASS Exception was thrown.
58 PASS ename is 'DataError'
59 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
60 Expecting exception from request = objectStore.put('value', new Date(NaN))
61 PASS Exception was thrown.
63 PASS ename is 'DataError'
64 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
65 Expecting exception from request = objectStore.put('value', {})
66 PASS Exception was thrown.
68 PASS ename is 'DataError'
69 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
70 Expecting exception from request = objectStore.put('value', /regex/)
71 PASS Exception was thrown.
73 PASS ename is 'DataError'
74 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
75 Expecting exception from request = objectStore.put('value', self)
76 PASS Exception was thrown.
78 PASS ename is 'DataError'
79 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
80 Expecting exception from request = objectStore.put('value', self.document)
81 PASS Exception was thrown.
83 PASS ename is 'DataError'
84 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
85 Expecting exception from request = objectStore.put('value', self.document.body)
86 PASS Exception was thrown.
88 PASS ename is 'DataError'
89 Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
90 PASS successfullyParsed is true