diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/IndexedDB/idbkeyrange.htm | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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.htm')
-rw-r--r-- | testing/web-platform/tests/IndexedDB/idbkeyrange.htm | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/testing/web-platform/tests/IndexedDB/idbkeyrange.htm b/testing/web-platform/tests/IndexedDB/idbkeyrange.htm new file mode 100644 index 000000000..dd6e5f7e5 --- /dev/null +++ b/testing/web-platform/tests/IndexedDB/idbkeyrange.htm @@ -0,0 +1,67 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>IDBKeyRange Tests</title> +<link rel="author" title="Microsoft" href="http://www.microsoft.com"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script src=support.js></script> + +<script> + // only + test( function() { + var keyRange = IDBKeyRange.only(1); + assert_true(keyRange instanceof IDBKeyRange, "keyRange instanceof IDBKeyRange"); + assert_equals(keyRange.lower, 1, "keyRange"); + assert_equals(keyRange.upper, 1, "keyRange"); + assert_false(keyRange.lowerOpen, "keyRange.lowerOpen"); + assert_false(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.only() - returns an IDBKeyRange and the properties are set correctly"); + + // lowerBound + test( function() { + var keyRange = IDBKeyRange.lowerBound(1, true) + assert_true(keyRange instanceof IDBKeyRange, "keyRange instanceof IDBKeyRange"); + assert_equals(keyRange.lower, 1, "keyRange.lower"); + assert_equals(keyRange.upper, undefined, "keyRange.upper"); + assert_true(keyRange.lowerOpen, "keyRange.lowerOpen"); + assert_true(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.lowerBound() - returns an IDBKeyRange and the properties are set correctly"); + + test( function() { + var keyRange = IDBKeyRange.lowerBound(1); + assert_false(keyRange.lowerOpen, "keyRange.lowerOpen"); + }, "IDBKeyRange.lowerBound() - 'open' parameter has correct default set"); + + // upperBound + test( function() { + var keyRange = IDBKeyRange.upperBound(1, true); + assert_true(keyRange instanceof IDBKeyRange, "keyRange instanceof IDBKeyRange"); + assert_equals(keyRange.lower, undefined, "keyRange.lower"); + assert_equals(keyRange.upper, 1, "keyRange.upper"); + assert_true(keyRange.lowerOpen, "keyRange.lowerOpen"); + assert_true(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.upperBound() - returns an IDBKeyRange and the properties are set correctly"); + + test( function() { + var keyRange = IDBKeyRange.upperBound(1); + assert_false(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.upperBound() - 'open' parameter has correct default set"); + + // bound + test( function() { + var keyRange = IDBKeyRange.bound(1, 2, true, true); + assert_true(keyRange instanceof IDBKeyRange, "keyRange instanceof IDBKeyRange"); + assert_equals(keyRange.lower, 1, "keyRange"); + assert_equals(keyRange.upper, 2, "keyRange"); + assert_true(keyRange.lowerOpen, "keyRange.lowerOpen"); + assert_true(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.bound() - returns an IDBKeyRange and the properties are set correctly"); + + test( function() { + var keyRange = IDBKeyRange.bound(1, 2); + assert_false(keyRange.lowerOpen, "keyRange.lowerOpen"); + assert_false(keyRange.upperOpen, "keyRange.upperOpen"); + }, "IDBKeyRange.bound() - 'lowerOpen' and 'upperOpen' parameters have correct defaults set"); +</script> + +<div id=log></div> |