OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>IDBObjectStore.openCursor() - invalid</title> |
| 3 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> |
| 4 <script src="../../../resources/testharness.js"></script> |
| 5 <script src="../../../resources/testharnessreport.js"></script> |
| 6 <script src="support.js"></script> |
| 7 |
| 8 <script> |
| 9 |
| 10 var db, open; |
| 11 |
| 12 setup(function() { |
| 13 open = indexedDB.open('testdb-' + new Date().getTime()); |
| 14 open.onupgradeneeded = function(e) { |
| 15 db = e.target.result; |
| 16 var objStore = db.createObjectStore("test"); |
| 17 objStore.createIndex("index", ""); |
| 18 |
| 19 objStore.add("data", 1); |
| 20 objStore.add("data2", 2); |
| 21 }; |
| 22 }, |
| 23 { explicit_done: true }); |
| 24 |
| 25 |
| 26 open.onsuccess = function() { |
| 27 |
| 28 async_test(document.title + " - pass something other than number").step(
function(e) { |
| 29 var idx = db.transaction("test").objectStore("test").index("index"); |
| 30 |
| 31 assert_throws("DataError", |
| 32 function() { idx.openCursor({ lower: "a" }); }); |
| 33 |
| 34 assert_throws("DataError", |
| 35 function() { idx.openCursor({ lower: "a", lowerOpen: false }); }
); |
| 36 |
| 37 assert_throws("DataError", |
| 38 function() { idx.openCursor({ lower: "a", lowerOpen: false, uppe
r: null, upperOpen: false }); }); |
| 39 |
| 40 this.done(); |
| 41 }); |
| 42 |
| 43 |
| 44 // Stop blocking the testing system from hereon |
| 45 done(); |
| 46 } |
| 47 |
| 48 </script> |
| 49 |
| 50 <div id="log"></div> |
OLD | NEW |