1 Test that IndexedDB's cursor key/primaryKey/value properties preserve mutations.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-properties.html"
7 indexedDB.deleteDatabase(dbname)
8 indexedDB.open(dbname, 1)
11 db = event.target.result
12 store = db.createObjectStore('store')
13 index = store.createIndex('index', 'id')
14 store.put({id: ['indexKey']}, ['primaryKey'])
17 db = event.target.result
18 trans = db.transaction('store')
19 store = trans.objectStore('store')
20 index = store.index('index')
22 request = index.openCursor()
25 cursor = event.target.result
26 PASS cursor is non-null.
27 PASS areArraysEqual(cursor.key, ['indexKey']) is true
28 PASS areArraysEqual(cursor.primaryKey, ['primaryKey']) is true
32 PASS v === cursor.key is true
35 PASS v === cursor.key is true
37 cursor.key.expando = 123
38 PASS cursor.key.expando is 123
42 PASS v === cursor.primaryKey is true
44 cursor.primaryKey = null
45 PASS v === cursor.primaryKey is true
47 cursor.primaryKey.expando = 123
48 PASS cursor.primaryKey.expando is 123
52 PASS v === cursor.value is true
55 PASS v === cursor.value is true
57 cursor.value.expando = 123
58 PASS cursor.value.expando is 123
59 PASS successfullyParsed is true