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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/idbkeyrange_incorrect.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 <!-- Submitted from TestTWF Paris -->
3 <html>
4 <head>
5 <meta charset=utf-8>
6 <title id='desc'>IDBKeyRange Tests - Incorrect</title>
7 <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overvi ew.html#range-concept">
8 <link rel=assert title="If the lower key is greater than the upper key, then a DOMException of type DataError must be thrown.">
9 <link rel=author href="mailto:chrcharles67@gmail.com" title="Christophe CHARLES">
10
11 <script src="../../../resources/testharness.js"></script>
12 <script src="../../../resources/testharnessreport.js"></script>
13 <script src="support.js"></script>
14
15 <script type="text/javascript">
16
17 // TypeError: bound requires more than 0 arguments
18 test( function() {
19 assert_throws(new TypeError(), function() {
20 IDBKeyRange.bound();
21 });
22 }, "IDBKeyRange.bound() - bound requires more than 0 arguments.");
23
24 // Null parameters
25 test( function() {
26 assert_throws("DataError", function() {
27 IDBKeyRange.bound(null, null);
28 });
29 }, "IDBKeyRange.bound(null, null) - null parameters are incorrect.") ;
30
31 // // Null parameter
32 test( function() {
33 assert_throws("DataError", function() {
34 IDBKeyRange.bound(1, null);
35 });
36 assert_throws("DataError", function() {
37 IDBKeyRange.bound(null, 1);
38 });
39 }, "IDBKeyRange.bound(1, null / null, 1) - null parameter is incorre ct.");
40
41 // bound incorrect
42 test( function() {
43 var lowerBad = Math.floor(Math.random()*31) + 5;
44 var upper = lowerBad - 1;
45 assert_throws("DataError", function() {
46 IDBKeyRange.bound(lowerBad, upper);
47 });
48 assert_throws("DataError", function() {
49 IDBKeyRange.bound('b', 'a');
50 });
51 }, "IDBKeyRange.bound(lower, upper / lower > upper) - 'lower' is gr eater than 'upper'."
52 );
53
54 test( function() {
55 assert_throws("DataError", function() {
56 IDBKeyRange.bound('a', 1);
57 });
58 assert_throws("DataError", function() {
59 IDBKeyRange.bound(new Date(), 1);
60 });
61 assert_throws("DataError", function() {
62 IDBKeyRange.bound([1, 2], 1);
63 });
64 }, "IDBKeyRange.bound(DOMString/Date/Array, 1) - A DOMString, Date a nd Array are greater than a float.");
65
66
67 // ReferenceError: the variable is not defined
68 test( function() {
69 var goodVariable = 1;
70 assert_throws(new ReferenceError(), function() {
71 IDBKeyRange.bound(noExistingVariable, 1);
72 });
73 assert_throws(new ReferenceError(), function() {
74 IDBKeyRange.bound(goodVariable, noExistingVariable);
75 });
76 }, "IDBKeyRange.bound(noExistingVariable, 1 / goodVariable, noExisti ngVariable) - noExistingVariable is not defined.");
77
78 // Valid type key error
79 test( function() {
80 assert_throws("DataError", function() {
81 IDBKeyRange.bound(true, 1);
82 });
83 }, "IDBKeyRange.bound(true, 1) - boolean is not a valid key type.");
84
85
86 </script>
87 </head>
88
89 <body>
90 <div id="log"></div>
91 </body>
92 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698