OLD | NEW |
1 Test IndexedDB's openCursor. | 1 Test IndexedDB's openCursor. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | |
7 | |
8 dbname = "cursor-index-delete.html" | 6 dbname = "cursor-index-delete.html" |
9 indexedDB.deleteDatabase(dbname) | 7 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 8 indexedDB.open(dbname) |
11 trans = event.target.transaction | 9 trans = event.target.transaction |
12 PASS trans is non-null. | 10 PASS trans is non-null. |
13 objectStore = db.createObjectStore('test') | 11 objectStore = db.createObjectStore('test') |
14 objectStore.createIndex('testIndex', 'x') | 12 objectStore.createIndex('testIndex', 'x') |
15 objectStore.add({x: 1}, 'myKey1') | 13 objectStore.add({x: 1}, 'myKey1') |
16 objectStore.add({x: 2}, 'myKey2') | 14 objectStore.add({x: 2}, 'myKey2') |
17 objectStore.add({x: 3}, 'myKey3') | 15 objectStore.add({x: 3}, 'myKey3') |
(...skipping 23 matching lines...) Expand all Loading... |
41 index = event.target.source.index('testIndex') | 39 index = event.target.source.index('testIndex') |
42 index.openCursor(keyRange) | 40 index.openCursor(keyRange) |
43 PASS [object IDBCursorWithValue] is non-null. | 41 PASS [object IDBCursorWithValue] is non-null. |
44 event.target.result.delete() | 42 event.target.result.delete() |
45 index.get(1) | 43 index.get(1) |
46 PASS event.target.result is undefined | 44 PASS event.target.result is undefined |
47 PASS successfullyParsed is true | 45 PASS successfullyParsed is true |
48 | 46 |
49 TEST COMPLETE | 47 TEST COMPLETE |
50 | 48 |
OLD | NEW |