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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/list_ordering.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>objectStoreNames and indexNames order</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# widl-IDBDatabase-objectStoreNames">
6 <link rel=assert title="The list must be sorted in ascending order using the alg orithm defined by step 4 of section 11.8.5, The Abstract Relational Comparison A lgorithm of the ECMAScript Language Specification [ECMA-262].">
7 <script src="../../../resources/testharness.js"></script>
8 <script src="../../../resources/testharnessreport.js"></script>
9 <script src="support.js"></script>
10
11 <script>
12 function list_order(desc, unsorted, expected) {
13 var objStore, db,
14 t = async_test(document.title + " - " + desc);
15
16 var open_rq = createdb(t);
17 open_rq.onupgradeneeded = function(e) {
18 db = e.target.result;
19 for (var i = 0; i < unsorted.length; i++)
20 objStore = db.createObjectStore(unsorted[i]);
21
22 assert_equals(db.objectStoreNames.length, expected.length, "objectSt oreNames length");
23 for (var i = 0; i < expected.length; i++)
24 assert_equals(db.objectStoreNames[i], expected[i], "objectStoreNa mes["+i+"]");
25
26 for (var i = 0; i < unsorted.length; i++)
27 objStore.createIndex(unsorted[i], "length");
28
29 assert_equals(objStore.indexNames.length, expected.length, "indexNam es length");
30 for (var i = 0; i < expected.length; i++)
31 assert_equals(objStore.indexNames[i], expected[i], "indexNames[" +i+"]");
32 };
33
34 open_rq.onsuccess = function(e) {
35 assert_equals(db.objectStoreNames.length, expected.length, "objectSt oreNames length");
36 for (var i = 0; i < expected.length; i++)
37 assert_equals(db.objectStoreNames[i], expected[i], "objectStoreN ames["+i+"]");
38
39 assert_equals(objStore.indexNames.length, expected.length, "indexNam es length");
40 for (var i = 0; i < expected.length; i++)
41 assert_equals(objStore.indexNames[i], expected[i], "indexNames[" +i+"]");
42
43 t.done();
44 };
45 }
46
47 list_order("numbers",
48 [123456, -12345, -123, 123, 1234, -1234, 0, 12345, -123456],
49 ["-123", "-1234", "-12345", "-123456", "0", "123", "1234", "12345", "123 456"]);
50
51 list_order("numbers 'overflow'",
52 [9, 1, 1000000000, 200000000000000000],
53 ["1", "1000000000", "200000000000000000", "9"]);
54
55 list_order("lexigraphical string sort",
56 [ "cc", "c", "aa", "a", "bb", "b", "ab", "", "ac" ],
57 [ "", "a", "aa", "ab", "ac", "b", "bb", "c", "cc" ]);
58
59 </script>
60
61 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698