modules/libpr0n/test/mochitest/test_bug399925.html
author Jesse Ruderman <jruderman@gmail.com>
Thu, 09 Oct 2008 14:23:59 -0700
changeset 20221 bad67e7ea71b69a1868632fecb0da7f779fd36cf
parent 13699 57eda7b89481efebe7598e89b49ec655de5280f9
child 28048 8f7b73d88f6bbedec99c6c8ef48b243ab922d05c
permissions -rw-r--r--
Add crashtest

<!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/MochiKit.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>