content/canvas/test/test_strokeText_throw.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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 type="application/javascript" 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.");
    23     }
    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.");
    29     }
    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.");
    35     }
    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.");
    41     }
    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.");
    47     }
    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.");
    53     }
    54     SimpleTest.finish();
    55   }
    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>

mercurial