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

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

Issue 1295773004: update-w3c-deps import using blink c936ac9d274f959a4b5908db6835bcd612fb1a9e: (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>IDBCursor.primaryKey</title> 2 <title>IDBCursor.primaryKey</title>
3 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> 3 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
4 <script src="../../../resources/testharness.js"></script> 4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script> 5 <script src="../../../resources/testharnessreport.js"></script>
6 <script src="support.js"></script> 6 <script src="support.js"></script>
7 7
8 <script> 8 <script>
9 9
10 function cursor_primarykey(key) 10 function cursor_primarykey(key)
(...skipping 15 matching lines...) Expand all
26 .objectStore("test") 26 .objectStore("test")
27 .index("index") 27 .index("index")
28 .openCursor(); 28 .openCursor();
29 29
30 cursor_rq.onsuccess = t.step_func(function(e) { 30 cursor_rq.onsuccess = t.step_func(function(e) {
31 var cursor = e.target.result; 31 var cursor = e.target.result;
32 32
33 assert_equals(cursor.value, "data", "prequisite cursor.value"); 33 assert_equals(cursor.value, "data", "prequisite cursor.value");
34 assert_equals(cursor.key, "data", "prequisite cursor.key"); 34 assert_equals(cursor.key, "data", "prequisite cursor.key");
35 35
36 assert_object_equals(cursor.primaryKey, key, 'primaryKey'); 36 assert_key_equals(cursor.primaryKey, key, 'primaryKey');
37 assert_readonly(cursor, 'primaryKey'); 37 assert_readonly(cursor, 'primaryKey');
38 38
39 if (key instanceof Array) { 39 if (key instanceof Array) {
40 cursor.primaryKey.push("new"); 40 cursor.primaryKey.push("new");
41 key.push("new"); 41 key.push("new");
42 42
43 assert_object_equals(cursor.primaryKey, key, 'primaryKey aft er array push'); 43 assert_key_equals(cursor.primaryKey, key, 'primaryKey after array push');
44 44
45 // But we can not change key (like readonly, just a bit diff erent) 45 // But we can not change key (like readonly, just a bit diff erent)
46 cursor.key = 10; 46 cursor.key = 10;
47 assert_object_equals(cursor.primaryKey, key, 'key after assi gnment'); 47 assert_key_equals(cursor.primaryKey, key, 'key after assignm ent');
48 } 48 }
49 49
50 t.done(); 50 t.done();
51 }); 51 });
52 }); 52 });
53 } 53 }
54 54
55 cursor_primarykey(1); 55 cursor_primarykey(1);
56 cursor_primarykey("key"); 56 cursor_primarykey("key");
57 cursor_primarykey(["my", "key"]); 57 cursor_primarykey(["my", "key"]);
58 58
59 </script> 59 </script>
60 60
61 <div id="log"></div> 61 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698