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 Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter
is not a valid key. |
84 Expecting exception from store.count({}) | 84 Expecting exception from store.count({}) |
85 PASS Exception was thrown. | 85 PASS Exception was thrown. |
86 PASS code is 0 | 86 PASS code is 0 |
87 PASS ename is 'DataError' | 87 PASS ename is 'DataError' |
88 Exception message: The parameter is not a valid key. | 88 Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter
is not a valid key. |
89 Expecting exception from store.count(/regex/) | 89 Expecting exception from store.count(/regex/) |
90 PASS Exception was thrown. | 90 PASS Exception was thrown. |
91 PASS code is 0 | 91 PASS code is 0 |
92 PASS ename is 'DataError' | 92 PASS ename is 'DataError' |
93 Exception message: The parameter is not a valid key. | 93 Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter
is not a valid key. |
94 | 94 |
95 test = {"key":0,"expected":1} | 95 test = {"key":0,"expected":1} |
96 request = store.count(test.key) | 96 request = store.count(test.key) |
97 PASS typeof request.result is "number" | 97 PASS typeof request.result is "number" |
98 PASS request.result is 1 | 98 PASS request.result is 1 |
99 | 99 |
100 test = {"key":100,"expected":0} | 100 test = {"key":100,"expected":0} |
101 request = store.count(test.key) | 101 request = store.count(test.key) |
102 PASS typeof request.result is "number" | 102 PASS typeof request.result is "number" |
103 PASS request.result is 0 | 103 PASS request.result is 0 |
104 | 104 |
105 test = {"key":null,"expected":100} | 105 test = {"key":null,"expected":100} |
106 request = store.count(test.key) | 106 request = store.count(test.key) |
107 PASS typeof request.result is "number" | 107 PASS typeof request.result is "number" |
108 PASS request.result is 100 | 108 PASS request.result is 100 |
109 PASS successfullyParsed is true | 109 PASS successfullyParsed is true |
110 | 110 |
111 TEST COMPLETE | 111 TEST COMPLETE |
112 | 112 |
OLD | NEW |