summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/IndexedDB/idbobjectstore_openCursor_invalid.htm
blob: e12db3bb64f51aaddb9444a35a4178d9a897edda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<title>IDBObjectStore.openCursor() - invalid</title>
<link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/support.js"></script>
<script>

indexeddb_test(
  function(t, db, tx) {
            var objStore = db.createObjectStore("test");
            objStore.createIndex("index", "");

            objStore.add("data",  1);
            objStore.add("data2", 2);
  },
  function(t, db, tx) {
            var idx = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index");

            assert_throws_dom("DataError",
                function() { idx.openCursor({ lower: "a" }); });

            assert_throws_dom("DataError",
                function() { idx.openCursor({ lower: "a", lowerOpen: false }); });

            assert_throws_dom("DataError",
                function() { idx.openCursor({ lower: "a", lowerOpen: false, upper: null, upperOpen: false }); });

            t.done();
  },
  document.title + " - pass something other than number"
);
</script>