| OLD | NEW |
| 1 Test IndexedDB's cursor update. | 1 Test IndexedDB's cursor update. |
| 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 = "cursor-update.html" | 8 dbname = "cursor-update.html" |
| 9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
| 10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 PASS event.target.result.value is "myUpdatedFoo4" | 103 PASS event.target.result.value is "myUpdatedFoo4" |
| 104 event.target.result.continue() | 104 event.target.result.continue() |
| 105 autoIncrementCheckCursor() | 105 autoIncrementCheckCursor() |
| 106 PASS counter is 5 | 106 PASS counter is 5 |
| 107 trans.objectStore('keyPathStore').openCursor(keyRange) | 107 trans.objectStore('keyPathStore').openCursor(keyRange) |
| 108 keyPathUpdateCursor() | 108 keyPathUpdateCursor() |
| 109 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) | 109 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) |
| 110 PASS Exception was thrown. | 110 PASS Exception was thrown. |
| 111 PASS code is 0 | 111 PASS code is 0 |
| 112 PASS ename is 'DataError' | 112 PASS ename is 'DataError' |
| 113 Exception message: The effective object store of this cursor uses in-line keys a
nd evaluating the key path of the value parameter results in a different value t
han the cursor's effective key. |
| 113 event.target.result.update({id: counter, number: 100 + counter++}) | 114 event.target.result.update({id: counter, number: 100 + counter++}) |
| 114 event.target.source.continue() | 115 event.target.source.continue() |
| 115 keyPathUpdateCursor() | 116 keyPathUpdateCursor() |
| 116 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) | 117 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) |
| 117 PASS Exception was thrown. | 118 PASS Exception was thrown. |
| 118 PASS code is 0 | 119 PASS code is 0 |
| 119 PASS ename is 'DataError' | 120 PASS ename is 'DataError' |
| 121 Exception message: The effective object store of this cursor uses in-line keys a
nd evaluating the key path of the value parameter results in a different value t
han the cursor's effective key. |
| 120 event.target.result.update({id: counter, number: 100 + counter++}) | 122 event.target.result.update({id: counter, number: 100 + counter++}) |
| 121 event.target.source.continue() | 123 event.target.source.continue() |
| 122 keyPathUpdateCursor() | 124 keyPathUpdateCursor() |
| 123 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) | 125 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) |
| 124 PASS Exception was thrown. | 126 PASS Exception was thrown. |
| 125 PASS code is 0 | 127 PASS code is 0 |
| 126 PASS ename is 'DataError' | 128 PASS ename is 'DataError' |
| 129 Exception message: The effective object store of this cursor uses in-line keys a
nd evaluating the key path of the value parameter results in a different value t
han the cursor's effective key. |
| 127 event.target.result.update({id: counter, number: 100 + counter++}) | 130 event.target.result.update({id: counter, number: 100 + counter++}) |
| 128 event.target.source.continue() | 131 event.target.source.continue() |
| 129 keyPathUpdateCursor() | 132 keyPathUpdateCursor() |
| 130 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) | 133 Expecting exception from event.target.result.update({id: 100 + counter, number:
100 + counter}) |
| 131 PASS Exception was thrown. | 134 PASS Exception was thrown. |
| 132 PASS code is 0 | 135 PASS code is 0 |
| 133 PASS ename is 'DataError' | 136 PASS ename is 'DataError' |
| 137 Exception message: The effective object store of this cursor uses in-line keys a
nd evaluating the key path of the value parameter results in a different value t
han the cursor's effective key. |
| 134 event.target.result.update({id: counter, number: 100 + counter++}) | 138 event.target.result.update({id: counter, number: 100 + counter++}) |
| 135 event.target.source.continue() | 139 event.target.source.continue() |
| 136 keyPathUpdateCursor() | 140 keyPathUpdateCursor() |
| 137 PASS counter is 5 | 141 PASS counter is 5 |
| 138 trans.objectStore('keyPathStore').openCursor(keyRange) | 142 trans.objectStore('keyPathStore').openCursor(keyRange) |
| 139 keyPathCheckCursor() | 143 keyPathCheckCursor() |
| 140 PASS event.target.result.key is counter | 144 PASS event.target.result.key is counter |
| 141 PASS event.target.result.value.id is counter | 145 PASS event.target.result.value.id is counter |
| 142 PASS event.target.result.value.number is 101 | 146 PASS event.target.result.value.number is 101 |
| 143 event.target.result.continue() | 147 event.target.result.continue() |
| (...skipping 15 matching lines...) Expand all Loading... |
| 159 keyPathCheckCursor() | 163 keyPathCheckCursor() |
| 160 PASS counter is 5 | 164 PASS counter is 5 |
| 161 trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange) | 165 trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange) |
| 162 keyCursor() | 166 keyCursor() |
| 163 PASS event.target.result.key is counter + 100 | 167 PASS event.target.result.key is counter + 100 |
| 164 PASS event.target.result.primaryKey is counter | 168 PASS event.target.result.primaryKey is counter |
| 165 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) | 169 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) |
| 166 PASS Exception was thrown. | 170 PASS Exception was thrown. |
| 167 PASS code is DOMException.INVALID_STATE_ERR | 171 PASS code is DOMException.INVALID_STATE_ERR |
| 168 PASS ename is 'InvalidStateError' | 172 PASS ename is 'InvalidStateError' |
| 173 Exception message: The cursor is a key cursor. |
| 169 event.target.result.continue(); | 174 event.target.result.continue(); |
| 170 keyCursor() | 175 keyCursor() |
| 171 PASS event.target.result.key is counter + 100 | 176 PASS event.target.result.key is counter + 100 |
| 172 PASS event.target.result.primaryKey is counter | 177 PASS event.target.result.primaryKey is counter |
| 173 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) | 178 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) |
| 174 PASS Exception was thrown. | 179 PASS Exception was thrown. |
| 175 PASS code is DOMException.INVALID_STATE_ERR | 180 PASS code is DOMException.INVALID_STATE_ERR |
| 176 PASS ename is 'InvalidStateError' | 181 PASS ename is 'InvalidStateError' |
| 182 Exception message: The cursor is a key cursor. |
| 177 event.target.result.continue(); | 183 event.target.result.continue(); |
| 178 keyCursor() | 184 keyCursor() |
| 179 PASS event.target.result.key is counter + 100 | 185 PASS event.target.result.key is counter + 100 |
| 180 PASS event.target.result.primaryKey is counter | 186 PASS event.target.result.primaryKey is counter |
| 181 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) | 187 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) |
| 182 PASS Exception was thrown. | 188 PASS Exception was thrown. |
| 183 PASS code is DOMException.INVALID_STATE_ERR | 189 PASS code is DOMException.INVALID_STATE_ERR |
| 184 PASS ename is 'InvalidStateError' | 190 PASS ename is 'InvalidStateError' |
| 191 Exception message: The cursor is a key cursor. |
| 185 event.target.result.continue(); | 192 event.target.result.continue(); |
| 186 keyCursor() | 193 keyCursor() |
| 187 PASS event.target.result.key is counter + 100 | 194 PASS event.target.result.key is counter + 100 |
| 188 PASS event.target.result.primaryKey is counter | 195 PASS event.target.result.primaryKey is counter |
| 189 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) | 196 Expecting exception from event.target.result.update({id: counter, number: counte
r + 200}) |
| 190 PASS Exception was thrown. | 197 PASS Exception was thrown. |
| 191 PASS code is DOMException.INVALID_STATE_ERR | 198 PASS code is DOMException.INVALID_STATE_ERR |
| 192 PASS ename is 'InvalidStateError' | 199 PASS ename is 'InvalidStateError' |
| 200 Exception message: The cursor is a key cursor. |
| 193 event.target.result.continue(); | 201 event.target.result.continue(); |
| 194 keyCursor() | 202 keyCursor() |
| 195 PASS counter is 5 | 203 PASS counter is 5 |
| 196 openBasicCursor() | 204 openBasicCursor() |
| 197 trans = db.transaction('basicStore') | 205 trans = db.transaction('basicStore') |
| 198 trans.objectStore('basicStore') | 206 trans.objectStore('basicStore') |
| 199 objectStore.openCursor(keyRange) | 207 objectStore.openCursor(keyRange) |
| 200 attemptUpdate() | 208 attemptUpdate() |
| 201 Expecting exception from cursor.update('myUpdatedValue') | 209 Expecting exception from cursor.update('myUpdatedValue') |
| 202 PASS Exception was thrown. | 210 PASS Exception was thrown. |
| 203 PASS code is 0 | 211 PASS code is 0 |
| 204 PASS ename is 'ReadOnlyError' | 212 PASS ename is 'ReadOnlyError' |
| 213 Exception message: A write operation was attempted in a read-only transaction. |
| 205 cursor.continue() | 214 cursor.continue() |
| 206 attemptUpdate() | 215 attemptUpdate() |
| 207 Expecting exception from cursor.update('myUpdatedValue') | 216 Expecting exception from cursor.update('myUpdatedValue') |
| 208 PASS Exception was thrown. | 217 PASS Exception was thrown. |
| 209 PASS code is 0 | 218 PASS code is 0 |
| 210 PASS ename is 'ReadOnlyError' | 219 PASS ename is 'ReadOnlyError' |
| 220 Exception message: A write operation was attempted in a read-only transaction. |
| 211 cursor.continue() | 221 cursor.continue() |
| 212 attemptUpdate() | 222 attemptUpdate() |
| 213 Expecting exception from cursor.update('myUpdatedValue') | 223 Expecting exception from cursor.update('myUpdatedValue') |
| 214 PASS Exception was thrown. | 224 PASS Exception was thrown. |
| 215 PASS code is 0 | 225 PASS code is 0 |
| 216 PASS ename is 'ReadOnlyError' | 226 PASS ename is 'ReadOnlyError' |
| 227 Exception message: A write operation was attempted in a read-only transaction. |
| 217 cursor.continue() | 228 cursor.continue() |
| 218 attemptUpdate() | 229 attemptUpdate() |
| 219 Expecting exception from cursor.update('myUpdatedValue') | 230 Expecting exception from cursor.update('myUpdatedValue') |
| 220 PASS Exception was thrown. | 231 PASS Exception was thrown. |
| 221 PASS code is 0 | 232 PASS code is 0 |
| 222 PASS ename is 'ReadOnlyError' | 233 PASS ename is 'ReadOnlyError' |
| 234 Exception message: A write operation was attempted in a read-only transaction. |
| 223 cursor.continue() | 235 cursor.continue() |
| 224 attemptUpdate() | 236 attemptUpdate() |
| 225 transactionComplete() | 237 transactionComplete() |
| 226 PASS successfullyParsed is true | 238 PASS successfullyParsed is true |
| 227 | 239 |
| 228 TEST COMPLETE | 240 TEST COMPLETE |
| 229 | 241 |
| OLD | NEW |