3 <title>IDBObjectStore.count() - returns the number of records that have keys with the key
</title>
4 <link rel=
"author" href=
"mailto:odinho@opera.com" title=
"Odin Hørthe Omdal">
5 <script src=/resources/testharness.js
></script>
6 <script src=/resources/testharnessreport.js
></script>
7 <script src=resources/support.js
></script>
12 createdb(async_test()).onupgradeneeded = function(e
) {
15 var store
= db
.createObjectStore("store", { keyPath
: "k" })
17 for (var i
= 0; i
< 5; i
++)
18 store
.add({ k
: "key_" + i
});
20 store
.count("key_2").onsuccess
= this.step_func(function(e
) {
21 assert_equals(e
.target
.result
, 1, "count(key_2)")
23 store
.count("key_").onsuccess
= this.step_func(function(e
) {
24 assert_equals(e
.target
.result
, 0, "count(key_)")