blob: 8c88cc9b6fb7ac735af9ad3f9a44e1a4273cb895 [file] [log] [blame]
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.imageData.create2.zero</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<h1>2d.imageData.create2.zero</h1>
<p class="desc">createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero</p>
<script>
var t = async_test("createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero");
t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(10, 0); });
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 10); });
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 0); });
t.done();
});
</script>