| Test IndexedDB cursor iterates correctly over values added during iteration. |
| |
| 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) |
| trans = event.target.transaction |
| PASS trans is non-null. |
| objectStore = db.createObjectStore('test') |
| objectStore.add(1, 1) |
| objectStore.add(2, 2) |
| objectStore.add(3, 3) |
| trans = db.transaction(['test'], 'readwrite') |
| trans.objectStore('test').openCursor() |
| PASS event.target.result.key is 1 |
| trans.objectStore('test').add(6, 6) |
| event.target.result.continue() |
| PASS event.target.result.key is 2 |
| trans.objectStore('test').add(5, 5) |
| event.target.result.continue() |
| PASS event.target.result.key is 3 |
| trans.objectStore('test').add(4, 4) |
| event.target.result.continue() |
| PASS event.target.result.key is 4 |
| event.target.result.continue() |
| PASS event.target.result.key is 5 |
| event.target.result.continue() |
| PASS event.target.result.key is 6 |
| event.target.result.continue() |
| PASS counter is 6 |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |