blob: ab575fe90c02e29ed4f6c23a2a141b9d5a2e86bc [file] [log] [blame]
chang.shu@nokia.comd5cb9102010-05-21 20:47:13 +00001<!DOCTYPE html>
2<title>Canvas test: 2d.pattern.repeat.empty</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 = '#f00';
16ctx.fillRect(0, 0, 100, 50);
17var img = document.getElementById('green-1x1.png');
18var pattern = ctx.createPattern(img, "");
19ctx.fillStyle = pattern;
20ctx.fillRect(0, 0, 200, 50);
21
22_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
23_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
24_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
25_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
26
27
28});
29</script>
30<img src="../images/green-1x1.png" id="green-1x1.png" class="resource">
31