Skip to content

Commit

Permalink
Test for drawImage of an SVG image
Browse files Browse the repository at this point in the history
  • Loading branch information
tagawa committed Feb 19, 2013
1 parent 6933738 commit 95db954
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions canvas2d/drawing-images-to-the-canvas/2d.drawImage.svg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<title>Canvas test: 2d.drawImage.animated.poster</title>
<meta name="author" content="Daniel Davis">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../../common/canvas-tests.js"></script>
<link rel="stylesheet" href="../../../common/canvas-tests.css">
<body class="show_output">

<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.svg</h1>
<p class="desc">drawImage() of an SVG image</p>

<div class="refs">Spec references:
<ul>
<li><a href="../annotated-spec/canvas.html#testrefs.2d.drawImage.svg">2d.drawImage.svg</a>
</ul>
</div>

<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="../../../images/green-100x50.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
var t = async_test("drawImage() of an SVG image");
_addTest(function(canvas, ctx) {

ctx.drawImage(document.getElementById('green.svg'), 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);


});
</script>
<img src="../../../images/green.svg" id="green.svg" class="resource">

3 changes: 3 additions & 0 deletions images/green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 95db954

Please sign in to comment.