summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm')
-rw-r--r--testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm92
1 files changed, 92 insertions, 0 deletions
diff --git a/testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm b/testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm
new file mode 100644
index 000000000..0449ca807
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/idbkeyrange_incorrect.htm
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<!-- Submitted from TestTWF Paris -->
+<html>
+ <head>
+ <meta charset=utf-8>
+ <title id='desc'>IDBKeyRange Tests - Incorrect</title>
+ <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#range-concept">
+ <link rel=assert title="If the lower key is greater than the upper key, then a DOMException of type DataError must be thrown.">
+ <link rel=author href="mailto:chrcharles67@gmail.com" title="Christophe CHARLES">
+
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="support.js"></script>
+
+ <script type="text/javascript">
+
+ // TypeError: bound requires more than 0 arguments
+ test( function() {
+ assert_throws(new TypeError(), function() {
+ IDBKeyRange.bound();
+ });
+ }, "IDBKeyRange.bound() - bound requires more than 0 arguments.");
+
+ // Null parameters
+ test( function() {
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(null, null);
+ });
+ }, "IDBKeyRange.bound(null, null) - null parameters are incorrect.");
+
+ // // Null parameter
+ test( function() {
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(1, null);
+ });
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(null, 1);
+ });
+ }, "IDBKeyRange.bound(1, null / null, 1) - null parameter is incorrect.");
+
+ // bound incorrect
+ test( function() {
+ var lowerBad = Math.floor(Math.random()*31) + 5;
+ var upper = lowerBad - 1;
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(lowerBad, upper);
+ });
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound('b', 'a');
+ });
+ }, "IDBKeyRange.bound(lower, upper / lower > upper) - 'lower' is greater than 'upper'."
+ );
+
+ test( function() {
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound('a', 1);
+ });
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(new Date(), 1);
+ });
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound([1, 2], 1);
+ });
+ }, "IDBKeyRange.bound(DOMString/Date/Array, 1) - A DOMString, Date and Array are greater than a float.");
+
+
+ // ReferenceError: the variable is not defined
+ test( function() {
+ var goodVariable = 1;
+ assert_throws(new ReferenceError(), function() {
+ IDBKeyRange.bound(noExistingVariable, 1);
+ });
+ assert_throws(new ReferenceError(), function() {
+ IDBKeyRange.bound(goodVariable, noExistingVariable);
+ });
+ }, "IDBKeyRange.bound(noExistingVariable, 1 / goodVariable, noExistingVariable) - noExistingVariable is not defined.");
+
+ // Valid type key error
+ test( function() {
+ assert_throws("DataError", function() {
+ IDBKeyRange.bound(true, 1);
+ });
+ }, "IDBKeyRange.bound(true, 1) - boolean is not a valid key type.");
+
+
+ </script>
+ </head>
+
+ <body>
+ <div id="log"></div>
+ </body>
+</html> \ No newline at end of file