| Ensure IndexedDB's write operations invalidate cursor prefetch caches |
| |
| 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) |
| |
| prepareDatabase(): |
| db = event.target.result |
| store = db.createObjectStore('store') |
| |
| onOpenSuccess(): |
| db = event.target.result |
| |
| ------------------------------------------- |
| |
| doPrefetchInvalidationTest(): |
| store = db.transaction('store', 'readwrite').objectStore('store') |
| Populate the store with 100 records. |
| cursorRequest = store.openCursor() |
| |
| continue50Times(): |
| PASS cursorRequest.result is non-null. |
| |
| doOperationAndContinue(): |
| store.delete(IDBKeyRange.bound(-Infinity, +Infinity)) |
| cursor = cursorRequest.result |
| cursor.continue() |
| |
| onContinueSuccess(): |
| PASS cursorRequest.result is null |
| |
| ------------------------------------------- |
| |
| doPrefetchInvalidationTest(): |
| store = db.transaction('store', 'readwrite').objectStore('store') |
| Populate the store with 100 records. |
| cursorRequest = store.openCursor() |
| |
| continue50Times(): |
| PASS cursorRequest.result is non-null. |
| |
| doOperationAndContinue(): |
| store.clear() |
| cursor = cursorRequest.result |
| cursor.continue() |
| |
| onContinueSuccess(): |
| PASS cursorRequest.result is null |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |