blob: fb8f2f441af62dea080911b534457e8009f21bd4 [file] [log] [blame]
pdr@google.com1e7cce52012-08-20 23:50:23 +00001<!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);
20
21 if (window.testRunner)
22 testRunner.notifyDone();
23 }, 1);
24 }
25
26 image.onload = function() {
27 if (window.testRunner) {
28 testRunner.waitUntilDone();
29 testRunner.setBackingScaleFactor(2, finishTest);
30 } else
31 finishTest();
32 }
33</script>
34</body>
35</html>