OLD | NEW |
1 Test IndexedDB keyPath with intrinsic properties | 1 Test IndexedDB keyPath with intrinsic properties |
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 = "keypath-intrinsic-properties.html" | 8 dbname = "keypath-intrinsic-properties.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 store = db.createObjectStore('store', {keyPath: 'id'}) | 11 store = db.createObjectStore('store', {keyPath: 'id'}) |
12 store.createIndex('string length', 'string.length') | 12 store.createIndex('string length', 'string.length') |
13 store.createIndex('array length', 'array.length') | 13 store.createIndex('array length', 'array.length') |
| 14 store.createIndex('blob size', 'blob.size') |
| 15 store.createIndex('blob type', 'blob.type') |
14 | 16 |
15 testKeyPaths(): | 17 testKeyPaths(): |
16 transaction = db.transaction('store', 'readwrite') | 18 transaction = db.transaction('store', 'readwrite') |
17 store = transaction.objectStore('store') | 19 store = transaction.objectStore('store') |
18 store.put({"id":"id#0","string":"","array":[]}) | 20 store.put({"id":"id#0","string":"","array":[],"blob":{"type":"type 0","size":0}}
) |
19 store.put({"id":"id#1","string":"xx","array":["x","x","x"]}) | 21 store.put({"id":"id#1","string":"xx","array":["x","x","x"],"blob":{"type":"type
1","size":4}}) |
20 store.put({"id":"id#2","string":"xxxx","array":["x","x","x","x","x","x"]}) | 22 store.put({"id":"id#2","string":"xxxx","array":["x","x","x","x","x","x"],"blob":
{"type":"type 2","size":8}}) |
21 store.put({"id":"id#3","string":"xxxxxx","array":["x","x","x","x","x","x","x","x
","x"]}) | 23 store.put({"id":"id#3","string":"xxxxxx","array":["x","x","x","x","x","x","x","x
","x"],"blob":{"type":"type 3","size":12}}) |
22 store.put({"id":"id#4","string":"xxxxxxxx","array":["x","x","x","x","x","x","x",
"x","x","x","x","x"]}) | 24 store.put({"id":"id#4","string":"xxxxxxxx","array":["x","x","x","x","x","x","x",
"x","x","x","x","x"],"blob":{"type":"type 4","size":16}}) |
23 request = store.index('string length').openCursor() | 25 request = store.index('string length').openCursor() |
24 PASS cursor.key is cursor.value.string.length | 26 PASS cursor.key is cursor.value.string.length |
25 PASS cursor.key is cursor.value.string.length | 27 PASS cursor.key is cursor.value.string.length |
26 PASS cursor.key is cursor.value.string.length | 28 PASS cursor.key is cursor.value.string.length |
27 PASS cursor.key is cursor.value.string.length | 29 PASS cursor.key is cursor.value.string.length |
28 PASS cursor.key is cursor.value.string.length | 30 PASS cursor.key is cursor.value.string.length |
29 request = store.index('array length').openCursor() | 31 request = store.index('array length').openCursor() |
30 PASS cursor.key is cursor.value.array.length | 32 PASS cursor.key is cursor.value.array.length |
31 PASS cursor.key is cursor.value.array.length | 33 PASS cursor.key is cursor.value.array.length |
32 PASS cursor.key is cursor.value.array.length | 34 PASS cursor.key is cursor.value.array.length |
33 PASS cursor.key is cursor.value.array.length | 35 PASS cursor.key is cursor.value.array.length |
34 PASS cursor.key is cursor.value.array.length | 36 PASS cursor.key is cursor.value.array.length |
| 37 request = store.index('blob size').openCursor() |
| 38 PASS cursor.key is cursor.value.blob.size |
| 39 PASS cursor.key is cursor.value.blob.size |
| 40 PASS cursor.key is cursor.value.blob.size |
| 41 PASS cursor.key is cursor.value.blob.size |
| 42 PASS cursor.key is cursor.value.blob.size |
| 43 request = store.index('blob type').openCursor() |
| 44 PASS cursor.key is cursor.value.blob.type |
| 45 PASS cursor.key is cursor.value.blob.type |
| 46 PASS cursor.key is cursor.value.blob.type |
| 47 PASS cursor.key is cursor.value.blob.type |
| 48 PASS cursor.key is cursor.value.blob.type |
35 PASS successfullyParsed is true | 49 PASS successfullyParsed is true |
36 | 50 |
37 TEST COMPLETE | 51 TEST COMPLETE |
38 | 52 |
OLD | NEW |