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">
7 <canvas id=
"c" width=
"100" height=
"50"><p class=
"fallback">FAIL (fallback content)
</p></canvas>
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'");
20 ctx
.textAlign
= 'end';
21 is(ctx
.textAlign
, 'end', 'textAlign getter returns incorrect value');
24 ctx
.textAlign
= 'left';
25 is(ctx
.textAlign
, 'left', 'textAlign getter returns incorrect value');
28 ctx
.textAlign
= 'center';
29 is(ctx
.textAlign
, 'center', 'textAlign getter returns incorrect value');
32 ctx
.textAlign
= 'right';
33 is(ctx
.textAlign
, 'right', 'textAlign getter returns incorrect value');
36 ctx
.textAlign
= 'start';
37 is(ctx
.textAlign
, 'start', 'textAlign getter returns incorrect value');
40 is(ctx
.textAlign
, 'right', 'textAlign not being stored in the context state');
43 is(ctx
.textAlign
, 'center', 'textAlign not being stored in the context state');
46 is(ctx
.textAlign
, 'left', 'textAlign not being stored in the context state');
49 is(ctx
.textAlign
, 'end', 'textAlign not being stored in the context state');
52 is(ctx
.textAlign
, 'start', 'textAlign not being stored in the context state');
54 if (!_deferred
) SimpleTest
.finish();