Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=728629 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <meta charset="utf-8"> |
michael@0 | 8 | <title>Test for Bug 728629</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <script type="application/javascript"> |
michael@0 | 12 | |
michael@0 | 13 | /** Test for Bug 728629 **/ |
michael@0 | 14 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 15 | function test() { |
michael@0 | 16 | var c = document.createElement('canvas'); |
michael@0 | 17 | document.body.appendChild(c); |
michael@0 | 18 | try { |
michael@0 | 19 | c.getContext("2d").strokeText("Hello",NaN,50); |
michael@0 | 20 | ok(true, "strokeText should not throw with NaN."); |
michael@0 | 21 | } catch (e) { |
michael@0 | 22 | ok(false, "strokeText should not throw with NaN."); |
michael@0 | 23 | } |
michael@0 | 24 | try { |
michael@0 | 25 | c.getContext("2d").strokeText("Hello",Infinity,50); |
michael@0 | 26 | ok(true, "strokeText should not throw with Infinity."); |
michael@0 | 27 | } catch (e) { |
michael@0 | 28 | ok(false, "strokeText should not throw with Infinity."); |
michael@0 | 29 | } |
michael@0 | 30 | try { |
michael@0 | 31 | c.getContext("2d").strokeText("Hello",undefined,50); |
michael@0 | 32 | ok(true, "strokeText should not throw with undefined."); |
michael@0 | 33 | } catch (e) { |
michael@0 | 34 | ok(false, "strokeText should not throw with undefined."); |
michael@0 | 35 | } |
michael@0 | 36 | try { |
michael@0 | 37 | c.getContext("2d").fillText("Hello",NaN,50); |
michael@0 | 38 | ok(true, "fillText should not throw with NaN."); |
michael@0 | 39 | } catch (e) { |
michael@0 | 40 | ok(false, "fillText should not throw with NaN."); |
michael@0 | 41 | } |
michael@0 | 42 | try { |
michael@0 | 43 | c.getContext("2d").fillText("Hello",Infinity,50); |
michael@0 | 44 | ok(true, "fillText should not throw with Infinity."); |
michael@0 | 45 | } catch (e) { |
michael@0 | 46 | ok(false, "fillText should not throw with Infinity."); |
michael@0 | 47 | } |
michael@0 | 48 | try { |
michael@0 | 49 | c.getContext("2d").fillText("Hello",undefined,50); |
michael@0 | 50 | ok(true, "fillText should not throw with undefined."); |
michael@0 | 51 | } catch (e) { |
michael@0 | 52 | ok(false, "fillText should not throw with undefined."); |
michael@0 | 53 | } |
michael@0 | 54 | SimpleTest.finish(); |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | </script> |
michael@0 | 58 | </head> |
michael@0 | 59 | <body onload="test();"> |
michael@0 | 60 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=728629">Mozilla Bug 728629</a> |
michael@0 | 61 | <p id="display"></p> |
michael@0 | 62 | <div id="content" style="display: none"> |
michael@0 | 63 | |
michael@0 | 64 | </div> |
michael@0 | 65 | <pre id="test"> |
michael@0 | 66 | </pre> |
michael@0 | 67 | </body> |
michael@0 | 68 | </html> |