diff options
Diffstat (limited to 'testing/web-platform/tests/typedarrays/Uint8ClampedArray_constructor.html')
-rw-r--r-- | testing/web-platform/tests/typedarrays/Uint8ClampedArray_constructor.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/typedarrays/Uint8ClampedArray_constructor.html b/testing/web-platform/tests/typedarrays/Uint8ClampedArray_constructor.html new file mode 100644 index 000000000..056952a4f --- /dev/null +++ b/testing/web-platform/tests/typedarrays/Uint8ClampedArray_constructor.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Typed Arrays Test: Uint8ClampedArray constructor</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="http://www.khronos.org/registry/typedarray/specs/latest/#7.1"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> + +test(function() { + var obj = new Uint8ClampedArray(new Uint8ClampedArray(8)); + assert_true(obj instanceof Uint8ClampedArray, "The constructor return Uint8ClampedArray"); + assert_equals(obj.length, 8, "The length of Uint8ClampedArray"); +}, "Check if the constructor(Uint8ClampedArray) create new Uint8ClampedArray"); + +test(function() { + var obj = new Uint8ClampedArray(new ArrayBuffer(8)); + assert_true(obj instanceof Uint8ClampedArray, "The constructor return Uint8ClampedArray"); + assert_equals(obj.length, 8, "The length of Uint8ClampedArray"); +}, "Check if the constructor(ArrayBuffer) create new Uint8ClampedArray"); + +test(function() { + var obj = new Uint8ClampedArray(new ArrayBuffer(8), 2); + assert_true(obj instanceof Uint8ClampedArray, "The constructor return object Uint8ClampedArray"); + assert_equals(obj.length, 6, "The length of Uint8ClampedArray"); +}, "Check if the constructor(ArrayBuffer, byteOffset) create new Uint8ClampedArray"); + +test(function() { + var obj = new Uint8ClampedArray(new ArrayBuffer(8), 2, 4); + assert_true(obj instanceof Uint8ClampedArray, "The constructor return object Uint8ClampedArray"); + assert_equals(obj.length, 4, "The length of Uint8ClampedArray"); +}, "Check if the constructor(ArrayBuffer, byteOffset, length) create new Uint8ClampedArray"); + +</script> |