Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / as-image / svg-as-image-canvas.html
blobfb8f2f441af62dea080911b534457e8009f21bd4
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for WK94377: canvas.context.drawImage() should draw SVG images at the correct scale.</title>
5 </head>
6 <body>
7 <div>
8 This test passes if there is a 100 x 100 green rect.<br/>
9 <canvas id="canvas" width="200" height="200"></canvas>
10 <img id="image" width="200" height="200" style="visibility: hidden;" src="resources/100px-green-rect.svg"></img>
11 </div>
12 <script>
13 function finishTest() {
14 var image = document.getElementById("image");
15 var canvas = document.getElementById("canvas");
16 setTimeout(function() {
17 var context = canvas.getContext('2d');
18 // We draw the 200x200 image that contains a 100x100 green rect.
19 context.drawImage(image, 0, 0, 200, 200);
21 if (window.testRunner)
22 testRunner.notifyDone();
23 }, 1);
26 image.onload = function() {
27 if (window.testRunner) {
28 testRunner.waitUntilDone();
29 testRunner.setBackingScaleFactor(2, finishTest);
30 } else
31 finishTest();
33 </script>
34 </body>
35 </html>