OLD | NEW |
1 Test IndexedDB's IDBObjectStore.count(). | 1 Test IndexedDB's IDBObjectStore.count(). |
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-count.html" | 8 dbname = "objectstore-count.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 verifying count with key | 74 verifying count with key |
75 trans = db.transaction('storeName', 'readonly') | 75 trans = db.transaction('storeName', 'readonly') |
76 PASS trans is non-null. | 76 PASS trans is non-null. |
77 store = trans.objectStore('storeName') | 77 store = trans.objectStore('storeName') |
78 PASS store is non-null. | 78 PASS store is non-null. |
79 Expecting exception from store.count(NaN) | 79 Expecting exception from store.count(NaN) |
80 PASS Exception was thrown. | 80 PASS Exception was thrown. |
81 PASS code is 0 | 81 PASS code is 0 |
82 PASS ename is 'DataError' | 82 PASS ename is 'DataError' |
| 83 Exception message: The parameter is not a valid key. |
83 Expecting exception from store.count({}) | 84 Expecting exception from store.count({}) |
84 PASS Exception was thrown. | 85 PASS Exception was thrown. |
85 PASS code is 0 | 86 PASS code is 0 |
86 PASS ename is 'DataError' | 87 PASS ename is 'DataError' |
| 88 Exception message: The parameter is not a valid key. |
87 Expecting exception from store.count(/regex/) | 89 Expecting exception from store.count(/regex/) |
88 PASS Exception was thrown. | 90 PASS Exception was thrown. |
89 PASS code is 0 | 91 PASS code is 0 |
90 PASS ename is 'DataError' | 92 PASS ename is 'DataError' |
| 93 Exception message: The parameter is not a valid key. |
91 | 94 |
92 test = {"key":0,"expected":1} | 95 test = {"key":0,"expected":1} |
93 request = store.count(test.key) | 96 request = store.count(test.key) |
94 PASS typeof request.result is "number" | 97 PASS typeof request.result is "number" |
95 PASS request.result is 1 | 98 PASS request.result is 1 |
96 | 99 |
97 test = {"key":100,"expected":0} | 100 test = {"key":100,"expected":0} |
98 request = store.count(test.key) | 101 request = store.count(test.key) |
99 PASS typeof request.result is "number" | 102 PASS typeof request.result is "number" |
100 PASS request.result is 0 | 103 PASS request.result is 0 |
101 | 104 |
102 test = {"key":null,"expected":100} | 105 test = {"key":null,"expected":100} |
103 request = store.count(test.key) | 106 request = store.count(test.key) |
104 PASS typeof request.result is "number" | 107 PASS typeof request.result is "number" |
105 PASS request.result is 100 | 108 PASS request.result is 100 |
106 PASS successfullyParsed is true | 109 PASS successfullyParsed is true |
107 | 110 |
108 TEST COMPLETE | 111 TEST COMPLETE |
109 | 112 |
OLD | NEW |