Bug 1935611 - Fix libyuv/libpng link failed for loongarch64. r=glandium,tnikkel,ng
[gecko.git] / dom / canvas / test / test_strokeText_throw.html
blob31104a3e1fbb56273dd9ffb6bdf31fc93d6ec7fe
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=728629
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 728629</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
13 /** Test for Bug 728629 **/
14 SimpleTest.waitForExplicitFinish();
15 function test() {
16 var c = document.createElement('canvas');
17 document.body.appendChild(c);
18 try {
19 c.getContext("2d").strokeText("Hello",NaN,50);
20 ok(true, "strokeText should not throw with NaN.");
21 } catch (e) {
22 ok(false, "strokeText should not throw with NaN.");
24 try {
25 c.getContext("2d").strokeText("Hello",Infinity,50);
26 ok(true, "strokeText should not throw with Infinity.");
27 } catch (e) {
28 ok(false, "strokeText should not throw with Infinity.");
30 try {
31 c.getContext("2d").strokeText("Hello",undefined,50);
32 ok(true, "strokeText should not throw with undefined.");
33 } catch (e) {
34 ok(false, "strokeText should not throw with undefined.");
36 try {
37 c.getContext("2d").fillText("Hello",NaN,50);
38 ok(true, "fillText should not throw with NaN.");
39 } catch (e) {
40 ok(false, "fillText should not throw with NaN.");
42 try {
43 c.getContext("2d").fillText("Hello",Infinity,50);
44 ok(true, "fillText should not throw with Infinity.");
45 } catch (e) {
46 ok(false, "fillText should not throw with Infinity.");
48 try {
49 c.getContext("2d").fillText("Hello",undefined,50);
50 ok(true, "fillText should not throw with undefined.");
51 } catch (e) {
52 ok(false, "fillText should not throw with undefined.");
54 SimpleTest.finish();
57 </script>
58 </head>
59 <body onload="test();">
60 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=728629">Mozilla Bug 728629</a>
61 <p id="display"></p>
62 <div id="content" style="display: none">
64 </div>
65 <pre id="test">
66 </pre>
67 </body>
68 </html>