OLD | NEW |
1 Test the basics of IndexedDB's webkitIDBIndex. | 1 Test the basics of IndexedDB's webkitIDBIndex. |
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 webkitIndexedDB.open('index-basics') | 6 webkitIndexedDB.open('index-basics') |
7 db = event.target.result | 7 db = event.target.result |
8 db.setVersion('new version') | 8 db.setVersion('new version') |
9 setVersionSuccess(): | 9 setVersionSuccess(): |
10 trans = event.target.result | 10 trans = event.target.result |
11 PASS trans !== null is true | 11 PASS trans !== null is true |
12 Deleted all object stores. | 12 Deleted all object stores. |
13 db.createObjectStore('storeName', null) | 13 db.createObjectStore('storeName', null) |
14 store.createIndex('indexName', 'x') | 14 store.createIndex('indexName', 'x') |
15 store.createIndex('indexName2', 'y', false) | 15 store.createIndex('indexName2', 'y', false) |
16 store.createIndex('zIndex', 'z', true) | 16 store.createIndex('zIndex', 'z', true) |
17 PASS 'name' in indexObject is true | 17 PASS 'name' in indexObject is true |
18 PASS indexObject.name is "indexName" | 18 PASS indexObject.name is "indexName" |
19 PASS 'objectStore' in indexObject is true | 19 PASS 'objectStore' in indexObject is true |
20 PASS indexObject.objectStore.name is "storeName" | 20 PASS indexObject.objectStore.name is "storeName" |
21 PASS 'keyPath' in indexObject is true | 21 PASS 'keyPath' in indexObject is true |
22 PASS indexObject.keyPath is "x" | 22 PASS indexObject.keyPath is "x" |
23 PASS 'unique' in indexObject is true | 23 PASS 'unique' in indexObject is true |
24 PASS indexObject.unique is false | 24 PASS indexObject.unique is false |
25 PASS 'openKeyCursor' in indexObject is true | 25 PASS 'openKeyCursor' in indexObject is true |
26 PASS 'openCursor' in indexObject is true | 26 PASS 'openCursor' in indexObject is true |
27 PASS 'getKey' in indexObject is true | 27 PASS 'getKey' in indexObject is true |
28 PASS 'get' in indexObject is true | 28 PASS 'get' in indexObject is true |
29 store.add({x: 'value', y: 'zzz', z: 2.72}, 'key') | 29 store.add({x: 'value', y: 'zzz', z: 2.72}, 'key') |
30 event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71}, 'key2') | 30 event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2') |
31 store.createIndex('indexWhileAddIsInFlight', 'x') | 31 store.createIndex('indexWhileAddIsInFlight', 'x') |
| 32 store.createIndex('indexWithWeirdKeyPath', 'foobar') |
32 indexObject.getKey('value') | 33 indexObject.getKey('value') |
33 PASS event.target.result is "key" | 34 PASS event.target.result is "key" |
34 indexObject2.getKey('zzz') | 35 indexObject2.getKey('zzz') |
35 PASS event.target.result is "key" | 36 PASS event.target.result is "key" |
36 indexObject3.get(2.71) | 37 indexObject3.get(2.71) |
37 PASS event.target.result.x is "value2" | 38 PASS event.target.result.x is "value2" |
38 indexObject.get('value') | 39 indexObject.get('value') |
39 PASS event.target.result.x is "value" | 40 PASS event.target.result.x is "value" |
40 PASS event.target.result.y is "zzz" | 41 PASS event.target.result.y is "zzz" |
41 indexObject.getKey('does not exist') | 42 indexObject.getKey('does not exist') |
(...skipping 29 matching lines...) Expand all Loading... |
71 event.target.result.continue() | 72 event.target.result.continue() |
72 PASS event.target.result === null is true | 73 PASS event.target.result === null is true |
73 Passing an invalid key into indexObject.get(). | 74 Passing an invalid key into indexObject.get(). |
74 PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 | 75 PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 |
75 Passing an invalid key into indexObject.getKey(). | 76 Passing an invalid key into indexObject.getKey(). |
76 PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 | 77 PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 |
77 PASS successfullyParsed is true | 78 PASS successfullyParsed is true |
78 | 79 |
79 TEST COMPLETE | 80 TEST COMPLETE |
80 | 81 |
OLD | NEW |