blob: 64586ee4d930e5ed8f5572a4f08efce21c19659b [file] [log] [blame]
chang.shu@nokia.comd5cb9102010-05-21 20:47:13 +00001<!DOCTYPE html>
2<title>Canvas test: 2d.shadow.stroke.cap.1</title>
3<script src="../tests.js"></script>
4<link rel="stylesheet" href="../tests.css">
andreas.kling@nokia.com7817c162010-11-07 13:49:39 +00005<body>
6<p id="passtext">Pass</p>
7<p id="failtext">Fail</p>
8<p class="output">These images should be identical:</p>
chang.shu@nokia.comd5cb9102010-05-21 20:47:13 +00009<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
10<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
11<ul id="d"></ul>
12<script>
13_addTest(function(canvas, ctx) {
14
15ctx.fillStyle = '#0f0';
16ctx.fillRect(0, 0, 100, 50);
17ctx.strokeStyle = '#f00';
18ctx.shadowColor = '#f00';
19ctx.shadowOffsetY = 50;
20ctx.beginPath();
21ctx.lineWidth = 50;
22ctx.lineCap = 'butt';
23ctx.moveTo(-50, -25);
24ctx.lineTo(0, -25);
25ctx.moveTo(100, -25);
26ctx.lineTo(150, -25);
27ctx.stroke();
28
29_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
30_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
31_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
32
33
34});
35</script>
36