Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 Verify that that cursors accessed after being closed are well behaved | 1 Verify that that cursors weakly hold request, and work if request is GC'd |
| 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; |
|
alecflett
2013/09/06 17:56:35
Not right now, but we really ought to scrub these
jsbell
2013/09/06 18:07:43
ISTR that we were waiting until the *reference* bo
| |
| 7 | 7 |
| 8 dbname = "closed-cursor.html" | 8 dbname = "cursor-request-cycle.html" |
| 9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
| 10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
| 11 | 11 |
| 12 prepareDatabase(): | 12 prepareDatabase(): |
| 13 db = event.target.result | 13 db = event.target.result |
| 14 store = db.createObjectStore('store') | 14 store = db.createObjectStore('store') |
| 15 store.put({value: 'value'}, ['key']) | |
| 16 | 15 |
| 17 onOpen(): | 16 onOpen(): |
| 18 db = event.target.result | 17 db = event.target.result |
| 19 tx = db.transaction('store') | 18 tx = db.transaction('store') |
| 20 store = tx.objectStore('store') | 19 store = tx.objectStore('store') |
| 21 cursorRequest = store.openCursor() | 20 cursorRequest = store.openCursor() |
| 21 otherRequest = store.get(0) | |
| 22 | 22 |
| 23 openCursorSuccess(): | 23 openCursorRequest(): |
| 24 cursor = cursorRequest.result | 24 cursor = cursorRequest.result |
| 25 Don't continue the cursor, so it retains its key/primaryKey/value | 25 PASS cursor is non-null. |
| 26 PASS cursor.key is "key1" | |
| 27 PASS cursor.value is "value1" | |
| 26 | 28 |
| 27 transactionComplete(): | 29 otherRequestSuccess(): |
| 28 PASS JSON.stringify(cursor.key) is "[\"key\"]" | 30 PASS afterCount is beforeCount |
| 29 PASS JSON.stringify(cursor.primaryKey) is "[\"key\"]" | 31 cursor.continue() |
| 30 PASS JSON.stringify(cursor.value) is "{\"value\":\"value\"}" | 32 finalRequest = store.get(0) |
| 33 | |
| 34 finalRequestSuccess(): | |
| 35 PASS cursor.key is "key2" | |
| 36 PASS cursor.value is "value2" | |
| 31 PASS successfullyParsed is true | 37 PASS successfullyParsed is true |
| 32 | 38 |
| 33 TEST COMPLETE | 39 TEST COMPLETE |
| 34 | 40 |
| OLD | NEW |