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