Revision 2d2df2a7e4a3e6a86add7e13bf8c96467b6d7ab5 authored by Andreas Tolfsen on 10 October 2016, 12:53:03 UTC, committed by jgraham on 10 October 2016, 12:53:03 UTC
1 parent 33f4da1
ArrayBuffer_constructor.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Typed Arrays Test: ArrayBuffer constructor</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="help" href="https://www.khronos.org/registry/typedarray/specs/latest/#5">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var args = [
/* numbers */
[NaN, 0], [+Infinity, 0], [-Infinity, 0], [+0, 0], [-0, 0],
[-0.4, 0], [-0.9, 0], [1.1, 1], [2.9, 2],
[1, 1], [-0xF1000000, 0],
/* strings */
["1", 1], ["1e2", 100],
/* null, undefined, booleans */
[undefined, 0], [null, 0], [false, 0], [true, 1]
];
args.forEach(function (arg, i) {
test(function () {
var abuffer = new ArrayBuffer(arg[0]);
assert_equals(abuffer.byteLength, arg[1]);
}, "The argument " + format_value(arg[0]) + " should be interpreted as " +
arg[1] + " for ArrayBuffer constructor." + i);
});
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...