Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_2d.composite.globalAlpha.invalid.html
blob4f29f5511d9560768c9375448557712c97baa10f
1 <!DOCTYPE HTML>
2 <title>Canvas test: 2d.composite.globalAlpha.invalid</title>
3 <script src="/MochiKit/MochiKit.js"></script>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
6 <body>
7 <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
8 <script>
10 SimpleTest.waitForExplicitFinish();
11 MochiKit.DOM.addLoadEvent(function () {
13 var canvas = document.getElementById('c');
14 var ctx = canvas.getContext('2d');
16 ctx.globalAlpha = 0.5;
17 var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons
18 var _thrown = undefined; try {
19 ctx.globalAlpha = Infinity;
20 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
21 ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
22 var _thrown = undefined; try {
23 ctx.globalAlpha = -Infinity;
24 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
25 ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
26 var _thrown = undefined; try {
27 ctx.globalAlpha = NaN;
28 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
29 ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
31 SimpleTest.finish();
33 });
34 </script>