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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbindex-multientry-big.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>IDBIndex.multiEntry - a 1000 entry multiEntry array</title>
4 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
5 <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html# key-construct">
6 <link rel=assert title="XXX">
7 <script src="../../../resources/testharness.js"></script>
8 <script src="../../../resources/testharnessreport.js"></script>
9 <script src="support.js"></script>
10
11 <script>
12 var db,
13 t_add = async_test("Adding one item with 1000 multiEntry keys", { timeou t: 10000 }),
14 t_get = async_test("Getting the one item by 1000 indeced keys ", { timeo ut: 10000 });
15
16 var open_rq = createdb(t_add);
17 var obj = { test: 'yo', idxkeys: [] };
18
19 for (var i = 0; i < 1000; i++)
20 obj.idxkeys.push('index_no_' + i);
21
22
23 open_rq.onupgradeneeded = function(e) {
24 db = e.target.result;
25
26 db.createObjectStore('store')
27 .createIndex('index', 'idxkeys', { multiEntry: true });
28 };
29 open_rq.onsuccess = function(e) {
30 var tx = db.transaction('store', 'readwrite');
31 tx.objectStore('store')
32 .put(obj, 1)
33 .onsuccess = t_add.step_func(function(e)
34 {
35 assert_equals(e.target.result, 1, "put'd key");
36 this.done();
37 });
38
39 tx.oncomplete = t_get.step_func(function() {
40 var idx = db.transaction('store').objectStore('store').index('index' )
41
42 for (var i = 0; i < 1000; i++)
43 {
44 idx.get('index_no_' + i).onsuccess = t_get.step_func(function(e) {
45 assert_equals(e.target.result.test, "yo");
46 });
47 }
48
49 idx.get('index_no_999').onsuccess = t_get.step_func(function(e) {
50 assert_equals(e.target.result.test, "yo");
51 assert_equals(e.target.result.idxkeys.length, 1000);
52 this.done();
53 });
54 });
55 };
56 </script>
57
58 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698