1 Verify that that key 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 = "key-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.openKeyCursor()
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 cursorRequest.extra = 123
32 Ensure request is not released if cursor is still around.
35 PASS cursorRequestObservation.wasCollected is false
39 PASS cursorObservation.wasCollected is false
40 finalRequest = store.get(0)
42 cursorContinueSuccess():
43 cursor = event.target.result
44 PASS cursor is non-null.
45 PASS cursor.key is "key2"
46 PASS event.target.extra is 123
47 PASS cursor.extra is 456
49 finalRequestSuccess():
50 PASS cursor.key is "key2"
53 PASS cursorRequestObservation.wasCollected is true
54 PASS cursorObservation.wasCollected is true
55 PASS successfullyParsed is true