Bug 1942639 - Propagate --filter argument from desktop_unittest.py to runreftest...
[gecko.git] / dom / bindings / test / test_large_imageData.html
blob68cb4bd50b9a20ba2a57f17b15ad1728b97775ff
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1716622
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for large ImageData</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1716622">Mozilla Bug 1716622</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
17 </div>
18 <pre id="test">
19 </pre>
20 <canvas id="canvas" width="800" height="800"></canvas>
21 <script type="application/javascript">
22 SimpleTest.waitForExplicitFinish();
24 function go() {
25 var ctx = document.getElementById("canvas").getContext("2d");
27 var ex = null;
28 try {
29 ctx.createImageData(23175, 23175);
30 } catch (e) {
31 ex = e;
33 ok(ex.toString().includes("Invalid width or height"),
34 "Expected createImageData exception");
36 ex = null;
37 try {
38 ctx.createImageData(33000, 33000);
39 } catch (e) {
40 ex = e;
42 ok(ex.toString().includes("Invalid width or height"),
43 "Expected createImageData exception");
45 ex = null;
46 try {
47 ctx.getImageData(0, 0, 23175, 23175);
48 } catch (e) {
49 ex = e;
51 ok(ex.toString().includes("negative or greater than the allowed amount"),
52 "Expected getImageData exception");
54 ex = null;
55 try {
56 new ImageData(23175, 23175);
57 } catch (e) {
58 ex = e;
60 ok(ex.toString().includes("negative or greater than the allowed amount"),
61 "Expected ImageData constructor exception");
63 SimpleTest.finish();
65 go();
66 </script>
67 </body>
68 </html>