1 Test IndexedDB keys ordering and readback from cursors.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-reverse-bug.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('store')
10 store.createIndex('index', '')
13 trans = db.transaction('store', 'readwrite')
14 store = trans.objectStore('store');
19 trans = db.transaction('store', 'readonly')
20 store = trans.objectStore('store');
21 index = store.index('index');
22 upperBound: 7 open: false expected: 3
23 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
24 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
25 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
26 cursor = event.target.result
27 PASS cursor.key is test.expected
28 PASS cursor.value is test.expected
29 PASS cursor.primaryKey is test.expected
30 cursor = event.target.result
31 PASS cursor.key is test.expected
32 PASS cursor.value is test.expected
33 PASS cursor.primaryKey is test.expected
34 cursor = event.target.result
35 PASS cursor.key is test.expected
36 PASS cursor.primaryKey is test.expected
38 trans = db.transaction('store', 'readonly')
39 store = trans.objectStore('store');
40 index = store.index('index');
41 upperBound: 7 open: true expected: 3
42 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
43 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
44 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
45 cursor = event.target.result
46 PASS cursor.key is test.expected
47 PASS cursor.value is test.expected
48 PASS cursor.primaryKey is test.expected
49 cursor = event.target.result
50 PASS cursor.key is test.expected
51 PASS cursor.value is test.expected
52 PASS cursor.primaryKey is test.expected
53 cursor = event.target.result
54 PASS cursor.key is test.expected
55 PASS cursor.primaryKey is test.expected
57 trans = db.transaction('store', 'readonly')
58 store = trans.objectStore('store');
59 index = store.index('index');
60 upperBound: 3 open: false expected: 3
61 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
62 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
63 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
64 cursor = event.target.result
65 PASS cursor.key is test.expected
66 PASS cursor.value is test.expected
67 PASS cursor.primaryKey is test.expected
68 cursor = event.target.result
69 PASS cursor.key is test.expected
70 PASS cursor.value is test.expected
71 PASS cursor.primaryKey is test.expected
72 cursor = event.target.result
73 PASS cursor.key is test.expected
74 PASS cursor.primaryKey is test.expected
76 trans = db.transaction('store', 'readonly')
77 store = trans.objectStore('store');
78 index = store.index('index');
79 upperBound: 3 open: true expected: 2
80 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
81 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
82 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
83 cursor = event.target.result
84 PASS cursor.key is test.expected
85 PASS cursor.value is test.expected
86 PASS cursor.primaryKey is test.expected
87 cursor = event.target.result
88 PASS cursor.key is test.expected
89 PASS cursor.value is test.expected
90 PASS cursor.primaryKey is test.expected
91 cursor = event.target.result
92 PASS cursor.key is test.expected
93 PASS cursor.primaryKey is test.expected
96 PASS successfullyParsed is true