2 <title>IDBCursor.continue() - attempt to call continue two times</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>
11 t = async_test(document.title, {timeout: 10000});
13 var open_rq = createdb(t);
14 open_rq.onupgradeneeded = function(e) {
16 var objStore = db.createObjectStore("test");
18 objStore.createIndex("index", "");
20 objStore.add("data", 1);
21 objStore.add("data2", 2);
24 open_rq.onsuccess = function(e) {
26 var cursor_rq = db.transaction("test")
31 cursor_rq.onsuccess = t.step_func(function(e) {
32 if (!e.target.result) {
33 assert_equals(count, 2, 'count');
37 var cursor = e.target.result;
39 cursor.continue(undefined);
42 assert_throws('InvalidStateError',
43 function() { cursor.continue(); }, 'second continue');
45 assert_throws('InvalidStateError',
46 function() { cursor.continue(3); }, 'third continue');