Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_text.textAlign.html
blobb5ccb490e50adc87a74ada15a94ac80522fefc32
1 <!DOCTYPE HTML>
2 <title>Canvas test: text.textAlign</title>
3 <script src="/MochiKit/MochiKit.js"></script>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" type="text/css" 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>
9 var _deferred = false;
11 SimpleTest.waitForExplicitFinish();
12 MochiKit.DOM.addLoadEvent(function () {
14 var canvas = document.getElementById('c');
15 var ctx = canvas.getContext('2d');
17 is(ctx.textAlign, 'start', "default textAlign is not 'start'");
19 ctx.save();
20 ctx.textAlign = 'end';
21 is(ctx.textAlign, 'end', 'textAlign getter returns incorrect value');
23 ctx.save();
24 ctx.textAlign = 'left';
25 is(ctx.textAlign, 'left', 'textAlign getter returns incorrect value');
27 ctx.save();
28 ctx.textAlign = 'center';
29 is(ctx.textAlign, 'center', 'textAlign getter returns incorrect value');
31 ctx.save();
32 ctx.textAlign = 'right';
33 is(ctx.textAlign, 'right', 'textAlign getter returns incorrect value');
35 ctx.save();
36 ctx.textAlign = 'start';
37 is(ctx.textAlign, 'start', 'textAlign getter returns incorrect value');
39 ctx.restore();
40 is(ctx.textAlign, 'right', 'textAlign not being stored in the context state');
42 ctx.restore();
43 is(ctx.textAlign, 'center', 'textAlign not being stored in the context state');
45 ctx.restore();
46 is(ctx.textAlign, 'left', 'textAlign not being stored in the context state');
48 ctx.restore();
49 is(ctx.textAlign, 'end', 'textAlign not being stored in the context state');
51 ctx.restore();
52 is(ctx.textAlign, 'start', 'textAlign not being stored in the context state');
54 if (!_deferred) SimpleTest.finish();
55 });
56 </script>