gecko/modules/libpr0n/test/mochitest/test_bug399925.html

49 lines
1.3 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=399925
-->
<head>
<title>Test for Bug 399925</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="drawCanvas(); setTimeout('drawCanvas(); allDone();', 20000)">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=399925">Mozilla Bug 399925</a>
<p id="display"></p>
<div id="content" style="display: none">
<img src="bug399925.gif" id="gif" />
<canvas id="canvas" width="100" height="100"> </canvas>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 399925 **/
SimpleTest.waitForExplicitFinish();
var pngResults = new Array();
function drawCanvas()
{
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var gif = document.getElementById('gif');
context.drawImage(gif, 0, 0);
ok(true, "we got through the drawImage call without an exception being thrown");
pngResults.push(canvas.toDataURL);
}
function allDone()
{
is(pngResults[0], pngResults[1], "got different rendered results");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>