OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <!-- test case for crbug.com/597127 --> | |
3 <html> | |
4 <head> | |
5 <!-- Use a <meta> viewport, see http://crbug.com/598949 --> | |
6 <meta name="viewport" content="width=device-width, minimum-scale=1.0"> | |
7 <style> | |
8 canvas { | |
9 border: 2px solid black; | |
10 margin: 5px 5px 0px 5px; | |
11 padding: 2px; | |
12 width: 150px; | |
13 height: 150px; | |
14 } | |
15 </style> | |
16 </head> | |
17 | |
18 <script> | |
19 if (window.testRunner) { | |
20 testRunner.dumpAsTextWithPixelResults(); | |
21 testRunner.waitUntilDone(); | |
22 } | |
23 | |
24 var totalTestImages = 4; | |
25 | |
26 window.onload = function() { | |
27 for (var x = 0; x < totalTestImages; ++x) | |
28 loadImage(x); | |
29 }; | |
30 | |
31 function loadImage(x) { | |
32 var image = new Image(); | |
33 | |
34 var canvas = document.createElement('canvas'); | |
35 canvas.width = canvas.height = 150; | |
36 | |
37 document.body.appendChild(canvas); | |
38 | |
39 image.onload = function() { | |
40 canvas.getContext('2d').drawImage(this, 0, 0, 150, 150); | |
41 setTimeout(canvasLoaded, 0, x + 1); | |
42 }; | |
43 | |
44 image.src = 'resources/ycbcr-progressive-00' + x + '.jpg'; | |
45 } | |
46 | |
47 function canvasLoaded(x) { | |
48 if (x >= totalTestImages && window.testRunner) | |
49 testRunner.notifyDone(); | |
50 } | |
51 </script> | |
52 </html> | |
OLD | NEW |