mirror of
https://github.com/servo/servo.git
synced 2025-07-12 01:43:43 +01:00
34 lines
1.4 KiB
HTML
34 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
|
<title>Canvas test: 2d.imageData.object.ctor.array.bounds</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/canvas-tests.js"></script>
|
|
<link rel="stylesheet" href="/common/canvas-tests.css">
|
|
<body class="show_output">
|
|
|
|
<h1>2d.imageData.object.ctor.array.bounds</h1>
|
|
<p class="desc">ImageData has a usable constructor</p>
|
|
|
|
|
|
<p class="output">Actual output:</p>
|
|
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
|
|
|
<ul id="d"></ul>
|
|
<script>
|
|
var t = async_test("ImageData has a usable constructor");
|
|
_addTest(function(canvas, ctx) {
|
|
|
|
_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
|
|
|
|
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(0), 1); });
|
|
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(3), 1); });
|
|
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 0); });
|
|
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 1, 2); });
|
|
assert_throws(new TypeError(), function() { new ImageData(new Uint8Array(8), 1, 2); });
|
|
assert_throws(new TypeError(), function() { new ImageData(new Int8Array(8), 1, 2); });
|
|
|
|
|
|
});
|
|
</script>
|
|
|