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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_put7.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 <meta charset="utf-8">
3 <title>IDBObjectStore.put() - autoIncrement and out-of-line keys </title>
4 <link rel="author" title="Microsoft" href="http://www.microsoft.com">
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 <script src="support.js"></script>
8
9 <script>
10 var db,
11 t = async_test(),
12 record = { property: "data" },
13 expected_keys = [ 1, 2, 3, 4 ];
14
15 var open_rq = createdb(t);
16 open_rq.onupgradeneeded = function(e) {
17 db = e.target.result;
18 var objStore = db.createObjectStore("store", { autoIncrement: true });
19
20 objStore.put(record);
21 objStore.put(record);
22 objStore.put(record);
23 objStore.put(record);
24 };
25
26 open_rq.onsuccess = function(e) {
27 var actual_keys = [],
28 rq = db.transaction("store")
29 .objectStore("store")
30 .openCursor();
31
32 rq.onsuccess = t.step_func(function(e) {
33 var cursor = e.target.result;
34
35 if (cursor) {
36 actual_keys.push(cursor.key);
37 cursor.continue();
38 }
39 else {
40 assert_array_equals(actual_keys, expected_keys);
41 t.done();
42 }
43 });
44 };
45 </script>
46
47 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698