diff options
Diffstat (limited to 'testing/web-platform/tests/html/canvas/element/pixel-manipulation/2d.imageData.put.wrongtype.html')
-rw-r--r-- | testing/web-platform/tests/html/canvas/element/pixel-manipulation/2d.imageData.put.wrongtype.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/element/pixel-manipulation/2d.imageData.put.wrongtype.html b/testing/web-platform/tests/html/canvas/element/pixel-manipulation/2d.imageData.put.wrongtype.html new file mode 100644 index 0000000000..9e43b1fbe9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/pixel-manipulation/2d.imageData.put.wrongtype.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.imageData.put.wrongtype</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> +<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.imageData.put.wrongtype</h1> +<p class="desc">putImageData() does not accept non-ImageData objects</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("putImageData() does not accept non-ImageData objects"); +_addTest(function(canvas, ctx) { + + var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.putImageData("cheese", 0, 0); }); + assert_throws_js(TypeError, function() { ctx.putImageData(42, 0, 0); }); + +}); +</script> + |