1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/image/test/mochitest/test_bug512435.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=512435 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 512435</title> 1.11 + <script type="application/javascript" src="/MochiKit/MochiKit.js"></script> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="text/javascript" src="/tests/image/test/mochitest/imgutils.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=512435">Mozilla Bug 512435</a> 1.18 +<img id="img_a"> 1.19 +<img id="img_b"> 1.20 +</div> 1.21 +<pre id="test"> 1.22 +<script type="application/javascript"> 1.23 + 1.24 +// Boilerplate 1.25 +const Ci = SpecialPowers.Ci; 1.26 +const Cc = SpecialPowers.Cc; 1.27 +SimpleTest.waitForExplicitFinish(); 1.28 + 1.29 +// We're relying on very particular behavior for certain images - clear the 1.30 +// image cache, _then_ set src 1.31 +clearImageCache(); 1.32 +document.getElementById("img_a").src = "damon.jpg"; 1.33 +document.getElementById("img_b").src = "shaver.png"; 1.34 + 1.35 +// Our handler 1.36 +function loadHandler() { 1.37 + 1.38 + // The two images should be decoded 1.39 + ok(isFrameDecoded("img_a"), "img_a should be decoded before onload fires"); 1.40 + ok(isFrameDecoded("img_b"), "img_b should be decoded before onload fires"); 1.41 + 1.42 + // All done 1.43 + SimpleTest.finish(); 1.44 +} 1.45 + 1.46 +// Set our onload handler 1.47 +window.onload = loadHandler; 1.48 + 1.49 +</script> 1.50 +</pre> 1.51 +</body> 1.52 +</html>