OLD | NEW |
1 Test IndexedDB's IDBObjectStore auto-increment feature. | 1 Test IndexedDB's IDBObjectStore auto-increment feature. |
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 = "objectstore-autoincrement.html" | 6 dbname = "objectstore-autoincrement.html" |
9 indexedDB.deleteDatabase(dbname) | 7 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 8 indexedDB.open(dbname) |
11 createObjectStore(): | 9 createObjectStore(): |
12 store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement:
true}) | 10 store = db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement:
true}) |
13 db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true}) | 11 db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true}) |
14 db.createObjectStore('PlainOldStore', {autoIncrement: false}) | 12 db.createObjectStore('PlainOldStore', {autoIncrement: false}) |
15 db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement
: true}) | 13 db.createObjectStore('StoreWithLongKeyPath', {keyPath: 'a.b.c.id', autoIncrement
: true}) |
16 storeNames = db.objectStoreNames | 14 storeNames = db.objectStoreNames |
17 PASS store.name is "StoreWithKeyPath" | 15 PASS store.name is "StoreWithKeyPath" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 PASS cursor.value.a.b.c.id is expected | 78 PASS cursor.value.a.b.c.id is expected |
81 expected = cursor.value.a.b.c.id + 1 | 79 expected = cursor.value.a.b.c.id + 1 |
82 PASS cursor.value.foo is "bar" | 80 PASS cursor.value.foo is "bar" |
83 PASS cursor.value.a.b.c.id is expected | 81 PASS cursor.value.a.b.c.id is expected |
84 expected = cursor.value.a.b.c.id + 1 | 82 expected = cursor.value.a.b.c.id + 1 |
85 PASS count is 4 | 83 PASS count is 4 |
86 PASS successfullyParsed is true | 84 PASS successfullyParsed is true |
87 | 85 |
88 TEST COMPLETE | 86 TEST COMPLETE |
89 | 87 |
OLD | NEW |