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; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "objectstore-autoincrement.html" | 8 dbname = "objectstore-autoincrement.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 store.get(6) | 51 store.get(6) |
52 getAbrahamSuccess(): | 52 getAbrahamSuccess(): |
53 PASS event.target.result.name is "Abraham" | 53 PASS event.target.result.name is "Abraham" |
54 PASS event.target.result.number is "2107" | 54 PASS event.target.result.number is "2107" |
55 store = trans.objectStore('PlainOldStore') | 55 store = trans.objectStore('PlainOldStore') |
56 Try adding with no key to object store without auto increment. | 56 Try adding with no key to object store without auto increment. |
57 Expecting exception from store.add({name: 'Adam'}) | 57 Expecting exception from store.add({name: 'Adam'}) |
58 PASS Exception was thrown. | 58 PASS Exception was thrown. |
59 PASS code is 0 | 59 PASS code is 0 |
60 PASS ename is 'DataError' | 60 PASS ename is 'DataError' |
61 Exception message: The object store uses out-of-line keys and has no key generat
or and the key parameter was not provided. | 61 Exception message: Failed to execute 'add' on 'IDBObjectStore': The object store
uses out-of-line keys and has no key generator and the key parameter was not pr
ovided. |
62 store.add({name: 'Adam'}, 1) | 62 store.add({name: 'Adam'}, 1) |
63 addAdamSuccess(): | 63 addAdamSuccess(): |
64 PASS event.target.result is 1 | 64 PASS event.target.result is 1 |
65 testLongKeyPath(): | 65 testLongKeyPath(): |
66 trans = db.transaction('StoreWithLongKeyPath', 'readwrite') | 66 trans = db.transaction('StoreWithLongKeyPath', 'readwrite') |
67 store = trans.objectStore('StoreWithLongKeyPath') | 67 store = trans.objectStore('StoreWithLongKeyPath') |
68 store.add({foo: 'bar'}) | 68 store.add({foo: 'bar'}) |
69 store.add({foo: 'bar', a: {}}) | 69 store.add({foo: 'bar', a: {}}) |
70 store.add({foo: 'bar', a: {b: {}}}) | 70 store.add({foo: 'bar', a: {b: {}}}) |
71 store.add({foo: 'bar', a: {b: {c: {}}}}) | 71 store.add({foo: 'bar', a: {b: {c: {}}}}) |
72 store.openCursor() | 72 store.openCursor() |
73 expected = null | 73 expected = null |
74 count = 0 | 74 count = 0 |
75 expected = cursor.value.a.b.c.id + 1 | 75 expected = cursor.value.a.b.c.id + 1 |
76 PASS cursor.value.foo is "bar" | 76 PASS cursor.value.foo is "bar" |
77 PASS cursor.value.a.b.c.id is expected | 77 PASS cursor.value.a.b.c.id is expected |
78 expected = cursor.value.a.b.c.id + 1 | 78 expected = cursor.value.a.b.c.id + 1 |
79 PASS cursor.value.foo is "bar" | 79 PASS cursor.value.foo is "bar" |
80 PASS cursor.value.a.b.c.id is expected | 80 PASS cursor.value.a.b.c.id is expected |
81 expected = cursor.value.a.b.c.id + 1 | 81 expected = cursor.value.a.b.c.id + 1 |
82 PASS cursor.value.foo is "bar" | 82 PASS cursor.value.foo is "bar" |
83 PASS cursor.value.a.b.c.id is expected | 83 PASS cursor.value.a.b.c.id is expected |
84 expected = cursor.value.a.b.c.id + 1 | 84 expected = cursor.value.a.b.c.id + 1 |
85 PASS count is 4 | 85 PASS count is 4 |
86 PASS successfullyParsed is true | 86 PASS successfullyParsed is true |
87 | 87 |
88 TEST COMPLETE | 88 TEST COMPLETE |
89 | 89 |
OLD | NEW |