Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_continue_invalid.htm

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
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>
7
8 <script>
9
10 var db,
11 t = async_test(document.title, {timeout: 10000});
12
13 var open_rq = createdb(t);
14 open_rq.onupgradeneeded = function(e) {
15 db = e.target.result;
16 var objStore = db.createObjectStore("test");
17
18 objStore.createIndex("index", "");
19
20 objStore.add("data", 1);
21 objStore.add("data2", 2);
22 };
23
24 open_rq.onsuccess = function(e) {
25 var count = 0;
26 var cursor_rq = db.transaction("test")
27 .objectStore("test")
28 .index("index")
29 .openCursor();
30
31 cursor_rq.onsuccess = t.step_func(function(e) {
32 if (!e.target.result) {
33 assert_equals(count, 2, 'count');
34 t.done();
35 return;
36 }
37 var cursor = e.target.result;
38
39 cursor.continue(undefined);
40
41 // Second try
42 assert_throws('InvalidStateError',
43 function() { cursor.continue(); }, 'second continue');
44
45 assert_throws('InvalidStateError',
46 function() { cursor.continue(3); }, 'third continue');
47
48 count++;
49 });
50 };
51
52 </script>
53
54 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698