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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_continue_index3.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() - index - attempt to iterate to the previous record when the direction is set for the next record </title>
3 <link rel="author" title="Microsoft" href="http://www.microsoft.com">
4 <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html# widl-IDBCursor-continue-void-any-key">
5 <link rel=assert title="The parameter is less than or equal to this cursor's pos ition and this cursor's direction is 'next' or 'nextunique'.">
6 <script src="../../../resources/testharness.js"></script>
7 <script src="../../../resources/testharnessreport.js"></script>
8 <script src="support.js"></script>
9
10 <script>
11
12 var db,
13 t = async_test(),
14 records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" },
15 { pKey: "primaryKey_1", iKey: "indexKey_1" } ];
16
17 var open_rq = createdb(t);
18 open_rq.onupgradeneeded = function(e) {
19 db = e.target.result;
20 var objStore = db.createObjectStore("test", {keyPath:"pKey"});
21
22 objStore.createIndex("index", "iKey");
23
24 for (var i = 0; i < records.length; i++)
25 objStore.add(records[i]);
26 };
27
28 open_rq.onsuccess = function(e) {
29 var count = 0;
30 var cursor_rq = db.transaction("test")
31 .objectStore("test")
32 .index("index")
33 .openCursor(undefined, "next"); // XXX: Fx has issue w ith "undefined"
34
35 cursor_rq.onsuccess = t.step_func(function(e) {
36 var cursor = e.target.result;
37 if (!cursor) {
38 assert_equals(count, 2, "ran number of times");
39 t.done();
40 }
41
42 // First time checks key equal, second time checks key less than
43 assert_throws("DataError",
44 function() { cursor.continue(records[0].iKey); });
45
46 cursor.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