OLD | NEW |
1 Test the basics of IndexedDB's webkitIDBIndex. | 1 Test the basics of IndexedDB's webkitIDBIndex. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "index-basics.html" | 8 dbname = "index-basics.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 indexObject.getKey('does not exist') | 62 indexObject.getKey('does not exist') |
63 PASS event.target.result is undefined | 63 PASS event.target.result is undefined |
64 indexObject.get('does not exist') | 64 indexObject.get('does not exist') |
65 PASS event.target.result is undefined | 65 PASS event.target.result is undefined |
66 indexObject4.getKey('value2') | 66 indexObject4.getKey('value2') |
67 PASS event.target.result is "key2" | 67 PASS event.target.result is "key2" |
68 | 68 |
69 Verify that specifying an invalid direction raises an exception: | 69 Verify that specifying an invalid direction raises an exception: |
70 Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-directi
on') | 70 Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-directi
on') |
71 PASS Exception was thrown. | 71 PASS Exception was thrown. |
72 PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Type err
or | 72 PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed t
o execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direct
ion') is not one of 'next', 'nextunique', 'prev', or 'prevunique'. |
73 | 73 |
74 indexObject.openKeyCursor() | 74 indexObject.openKeyCursor() |
75 PASS event.target.source is indexObject | 75 PASS event.target.source is indexObject |
76 PASS event.target.result is non-null. | 76 PASS event.target.result is non-null. |
77 PASS event.target.result.key is "value" | 77 PASS event.target.result.key is "value" |
78 PASS event.target.result.primaryKey is "key" | 78 PASS event.target.result.primaryKey is "key" |
79 event.target.result.continue() | 79 event.target.result.continue() |
80 PASS event.target.result is non-null. | 80 PASS event.target.result is non-null. |
81 PASS event.target.result.key is "value2" | 81 PASS event.target.result.key is "value2" |
82 PASS event.target.result.primaryKey is "key2" | 82 PASS event.target.result.primaryKey is "key2" |
83 event.target.result.continue() | 83 event.target.result.continue() |
84 PASS event.target.result is non-null. | 84 PASS event.target.result is non-null. |
85 PASS event.target.result.key is "value3" | 85 PASS event.target.result.key is "value3" |
86 PASS event.target.result.primaryKey is "key3" | 86 PASS event.target.result.primaryKey is "key3" |
87 event.target.result.continue() | 87 event.target.result.continue() |
88 PASS event.target.result is non-null. | 88 PASS event.target.result is non-null. |
89 PASS event.target.result.key is "value4" | 89 PASS event.target.result.key is "value4" |
90 PASS event.target.result.primaryKey is "key4" | 90 PASS event.target.result.primaryKey is "key4" |
91 event.target.result.continue() | 91 event.target.result.continue() |
92 PASS event.target.result is null | 92 PASS event.target.result is null |
93 | 93 |
94 Verify that specifying an invalid direction raises an exception: | 94 Verify that specifying an invalid direction raises an exception: |
95 Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction'
) | 95 Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction'
) |
96 PASS Exception was thrown. | 96 PASS Exception was thrown. |
97 PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Type error | 97 PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to e
xecute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction')
is not one of 'next', 'nextunique', 'prev', or 'prevunique'. |
98 | 98 |
99 indexObject.openCursor() | 99 indexObject.openCursor() |
100 PASS event.target.source is indexObject | 100 PASS event.target.source is indexObject |
101 PASS event.target.result is non-null. | 101 PASS event.target.result is non-null. |
102 PASS event.target.result.key is "value" | 102 PASS event.target.result.key is "value" |
103 PASS event.target.result.value.x is "value" | 103 PASS event.target.result.value.x is "value" |
104 PASS event.target.result.value.y is "zzz" | 104 PASS event.target.result.value.y is "zzz" |
105 event.target.result.continue() | 105 event.target.result.continue() |
106 PASS event.target.result is non-null. | 106 PASS event.target.result is non-null. |
107 PASS event.target.result.key is "value2" | 107 PASS event.target.result.key is "value2" |
(...skipping 26 matching lines...) Expand all Loading... |
134 Passing an invalid key into indexObject.getKey({}). | 134 Passing an invalid key into indexObject.getKey({}). |
135 Expecting exception from indexObject.getKey({}) | 135 Expecting exception from indexObject.getKey({}) |
136 PASS Exception was thrown. | 136 PASS Exception was thrown. |
137 PASS code is 0 | 137 PASS code is 0 |
138 PASS ename is 'DataError' | 138 PASS ename is 'DataError' |
139 Exception message: Failed to execute 'getKey' on 'IDBIndex': The parameter is no
t a valid key. | 139 Exception message: Failed to execute 'getKey' on 'IDBIndex': The parameter is no
t a valid key. |
140 PASS successfullyParsed is true | 140 PASS successfullyParsed is true |
141 | 141 |
142 TEST COMPLETE | 142 TEST COMPLETE |
143 | 143 |
OLD | NEW |