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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor-key.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.key</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 function cursor_key(key)
11 {
12 var db,
13 t = async_test(document.title + " - " + key);
14
15 var open_rq = createdb(t);
16 open_rq.onupgradeneeded = function(e) {
17 db = e.target.result;
18 var objStore = db.createObjectStore("test");
19
20 objStore.add("data", key);
21 };
22
23 open_rq.onsuccess = t.step_func(function(e) {
24 var cursor_rq = db.transaction("test")
25 .objectStore("test")
26 .openCursor();
27
28 cursor_rq.onsuccess = t.step_func(function(e) {
29 var cursor = e.target.result;
30 assert_equals(cursor.value, "data", "prequisite cursor.value");
31
32 assert_object_equals(cursor.key, key, 'key');
33 assert_readonly(cursor, 'key');
34
35 if (key instanceof Array) {
36 cursor.key.push("new");
37 key.push("new");
38
39 assert_object_equals(cursor.key, key, 'key after array push' );
40
41 // But we can not change key (like readonly, just a bit diff erent)
42 cursor.key = 10;
43 assert_object_equals(cursor.key, key, 'key after assignment' );
44 }
45
46 t.done();
47 });
48 });
49 }
50
51 cursor_key(1);
52 cursor_key("key");
53 cursor_key(["my", "key"]);
54
55 </script>
56
57 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698