Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: LayoutTests/fast/canvas/patternfill-repeat.html

Issue 187393007: Convert some pixel tests in fast/canvas into ref tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <title>createPattern repeat test</title> 4 <title>createPattern repeat test</title>
5 <style> canvas { border:solid #000 } </style> 5 <style> canvas { border:solid #000 } </style>
6 <script> 6 <script>
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsTextWithPixelResults();
9 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
10 } 9 }
11 window.onload = function(){ 10 window.onload = function(){
12 var i = new Image(); 11 var i = new Image();
13 i.src = "resources/apple.gif"; 12 i.src = "resources/apple.gif";
14 i.onload = function() { 13 i.onload = function() {
15 var ctx = document.getElementsByTagName('canvas')[0].getContext('2d'); 14 var ctx = document.getElementsByTagName('canvas')[0].getContext('2d');
16 var p; 15 var p;
17 16
18 //ctx.strokeWidth(1.0); 17 //ctx.strokeWidth(1.0);
19 p = ctx.createPattern(i, "repeat"); 18 p = ctx.createPattern(i, "repeat");
20 ctx.fillStyle = p; 19 ctx.fillStyle = p;
21 ctx.translate(10, 10); 20 ctx.translate(10, 10);
22 ctx.strokeRect(0, 0, 150, 150);
23 ctx.fillRect(0, 0, 150, 150); 21 ctx.fillRect(0, 0, 150, 150);
24 22
25 px = ctx.createPattern(i, "repeat-x"); 23 px = ctx.createPattern(i, "repeat-x");
26 ctx.fillStyle = px; 24 ctx.fillStyle = px;
27 ctx.translate(0, 160); 25 ctx.translate(0, 160);
28 ctx.strokeRect(0, 0, 150, 150);
29 ctx.fillRect(0, 0, 150, 150); 26 ctx.fillRect(0, 0, 150, 150);
30 27
31 pn = ctx.createPattern(i, "no-repeat"); 28 pn = ctx.createPattern(i, "no-repeat");
32 ctx.fillStyle = pn; 29 ctx.fillStyle = pn;
33 ctx.translate(160, 0); 30 ctx.translate(160, 0);
34 ctx.strokeRect(0, 0, 150, 150);
35 ctx.fillRect(0, 0, 150, 150); 31 ctx.fillRect(0, 0, 150, 150);
36 32
37 py = ctx.createPattern(i, "repeat-y"); 33 py = ctx.createPattern(i, "repeat-y");
38 ctx.fillStyle = py; 34 ctx.fillStyle = py;
39 ctx.translate(0, -160); 35 ctx.translate(0, -160);
40 ctx.strokeRect(0, 0, 150, 150);
41 ctx.fillRect(0, 0, 150, 150); 36 ctx.fillRect(0, 0, 150, 150);
42 37
43 if (window.testRunner) 38 if (window.testRunner)
44 testRunner.notifyDone(); 39 testRunner.notifyDone();
45 } 40 }
46 } 41 }
47 </script> 42 </script>
48 </head> 43 </head>
49 <body> 44 <body>
50 <p>There should be one big square below containing four squares. Top left squa re should be filled with 3 rows of 2 and bit Apple images. Top right square shou ld be 2 and a bit rows with one Apple image column along the left edge of the sq uare. Bottom left square should be one row with three Apple images along the top of the square. Bottom right square should be one Apple image in top left corner .</p> 45 <p>There should be one big square below containing four squares. Top left squa re should be filled with 3 rows of 2 and bit Apple images. Top right square shou ld be 2 and a bit rows with one Apple image column along the left edge of the sq uare. Bottom left square should be one row with three Apple images along the top of the square. Bottom right square should be one Apple image in top left corner .</p>
51 <p><canvas height="330" width="330"></canvas></p> 46 <p><canvas height="330" width="330"></canvas></p>
52 </body> 47 </body>
53 </html> 48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698