1 Verify that that cursors weakly hold request, and work if request is GC'd
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-request-cycle.html"
7 indexedDB.deleteDatabase(dbname)
11 db = event.target.result
12 store = db.createObjectStore('store')
15 db = event.target.result
16 tx = db.transaction('store')
17 store = tx.objectStore('store')
18 cursorRequest = store.openCursor()
19 otherRequest = store.get(0)
21 openCursorRequestSuccess():
22 Result will be checked later, to ensure that lazy access is safe
24 otherRequestSuccess():
25 Verify that the request's result can be accessed lazily:
27 cursor = cursorRequest.result
28 PASS cursor is non-null.
29 PASS cursor.key is "key1"
30 PASS cursor.value is "value1"
31 cursorRequest.extra = 123
33 Ensure request is not released if cursor is still around.
36 PASS cursorRequestObservation.wasCollected is false
40 PASS cursorObservation.wasCollected is false
41 finalRequest = store.get(0)
43 cursorContinueSuccess():
44 cursor = event.target.result
45 PASS cursor is non-null.
46 PASS cursor.key is "key2"
47 PASS cursor.value is "value2"
48 PASS event.target.extra is 123
49 PASS cursor.extra is 456
51 finalRequestSuccess():
52 PASS cursor.key is "key2"
53 PASS cursor.value is "value2"
56 PASS cursorRequestObservation.wasCollected is true
57 PASS cursorObservation.wasCollected is true
58 PASS successfullyParsed is true