1 Test IndexedDB's cursor skips deleted entries. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 webkitIndexedDB.open('cursor-skip-deleted') 7 db = event.target.result 8 db.setVersion('new version') 9 setVersionSuccess(): 10 trans = event.target.result 11 PASS trans !== null is true 12 Deleted all object stores. 13 objectStore = db.createObjectStore('store', {keyPath: 'id'}) 14 objectStore.createIndex('nameIndex', 'name') 15 16 resetObjectStore(): 17 18 basicCursorTest() 19 trans = db.transaction([], webkitIDBTransaction.READ_WRITE) 20 21 testCursor(): 22 trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0)) 23 0: Alpha 24 1: Bravo 25 request = trans.objectStore('store').delete(0) 26 2: Charlie 27 request = trans.objectStore('store').delete(25) 28 3: Delta 29 request = trans.objectStore('store').delete(5) 30 request = trans.objectStore('store').delete(6) 31 request = trans.objectStore('store').delete(7) 32 4: Echo 33 8: India 34 9: Juliet 35 10: Kilo 36 request = trans.objectStore('store').delete(10) 37 11: Lima 38 12: Mike 39 request = trans.objectStore('store').delete(13) 40 14: Oscar 41 15: Papa 42 request = trans.objectStore('store').delete(14) 43 16: Quebec 44 17: Romeo 45 18: Sierra 46 19: Tango 47 20: Uniform 48 request = trans.objectStore('store').delete(17) 49 request = trans.objectStore('store').delete(18) 50 21: Victor 51 22: Whiskey 52 23: X-ray 53 24: Yankee 54 55 56 resetObjectStore(): 57 58 reverseCursorTest(): 59 60 testCursor(): 61 trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0), webkitIDBCursor.PREV) 62 25: Zulu 63 24: Yankee 64 request = trans.objectStore('store').delete(25) 65 23: X-ray 66 request = trans.objectStore('store').delete(0) 67 22: Whiskey 68 request = trans.objectStore('store').delete(20) 69 request = trans.objectStore('store').delete(19) 70 request = trans.objectStore('store').delete(18) 71 21: Victor 72 17: Romeo 73 16: Quebec 74 15: Papa 75 request = trans.objectStore('store').delete(15) 76 14: Oscar 77 13: November 78 request = trans.objectStore('store').delete(12) 79 11: Lima 80 10: Kilo 81 request = trans.objectStore('store').delete(11) 82 9: Juliet 83 8: India 84 7: Hotel 85 6: Golf 86 5: Foxtrot 87 request = trans.objectStore('store').delete(7) 88 request = trans.objectStore('store').delete(8) 89 4: Echo 90 3: Delta 91 2: Charlie 92 1: Bravo 93 94 95 resetObjectStore(): 96 97 indexCursorTest(): 98 99 testCursor(): 100 trans.objectStore('store').index('nameIndex').openCursor(webkitIDBKeyRange.lowerBound('Alpha')) 101 0: Alpha 102 1: Bravo 103 request = trans.objectStore('store').delete(0) 104 2: Charlie 105 request = trans.objectStore('store').delete(25) 106 3: Delta 107 request = trans.objectStore('store').delete(5) 108 request = trans.objectStore('store').delete(6) 109 request = trans.objectStore('store').delete(7) 110 4: Echo 111 8: India 112 9: Juliet 113 10: Kilo 114 request = trans.objectStore('store').delete(10) 115 11: Lima 116 12: Mike 117 request = trans.objectStore('store').delete(13) 118 14: Oscar 119 15: Papa 120 request = trans.objectStore('store').delete(14) 121 16: Quebec 122 17: Romeo 123 18: Sierra 124 19: Tango 125 20: Uniform 126 request = trans.objectStore('store').delete(17) 127 request = trans.objectStore('store').delete(18) 128 21: Victor 129 22: Whiskey 130 23: X-ray 131 24: Yankee 132 133 transactionComplete(): 134 PASS successfullyParsed is true 135 136 TEST COMPLETE 137 138