OLD | NEW |
1 Test features of IndexedDB's unique indices. | 1 Test features of IndexedDB's unique indices. |
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 = "index-unique.html" | 6 dbname = "index-unique.html" |
9 indexedDB.deleteDatabase(dbname) | 7 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 8 indexedDB.open(dbname) |
11 db.createObjectStore('store') | 9 db.createObjectStore('store') |
12 store.createIndex('index', 'x', {unique: true}) | 10 store.createIndex('index', 'x', {unique: true}) |
13 setVersionCompleted(): | 11 setVersionCompleted(): |
14 transaction = db.transaction(['store'], 'readwrite') | 12 transaction = db.transaction(['store'], 'readwrite') |
15 transaction.objectStore('store').put({x: 1}, 'foo') | 13 transaction.objectStore('store').put({x: 1}, 'foo') |
16 addMoreData(): | 14 addMoreData(): |
17 transaction.objectStore('store').put({x: 1}, 'bar') | 15 transaction.objectStore('store').put({x: 1}, 'bar') |
(...skipping 12 matching lines...) Expand all Loading... |
30 addMoreDataSucces(): | 28 addMoreDataSucces(): |
31 transaction.objectStore('store').delete('bar') | 29 transaction.objectStore('store').delete('bar') |
32 deleteSuccess(): | 30 deleteSuccess(): |
33 transaction.objectStore('store').put({x: 1}, 'baz') | 31 transaction.objectStore('store').put({x: 1}, 'baz') |
34 finalAddSuccess(): | 32 finalAddSuccess(): |
35 transaction.objectStore('store').put({x: 1}, 'baz') | 33 transaction.objectStore('store').put({x: 1}, 'baz') |
36 PASS successfullyParsed is true | 34 PASS successfullyParsed is true |
37 | 35 |
38 TEST COMPLETE | 36 TEST COMPLETE |
39 | 37 |
OLD | NEW |