Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / image / test / mochitest / test_bug466586.html
blobcf34bb7831ba1ae1eab0d5cca44df5c0506e47df
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=466586
5 -->
6 <head>
7 <title>Test for Bug 466586</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 </head>
12 <body onload="loadSmall();">
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=89419">Mozilla Bug 466586</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 <img id="big" src="big.png"/>
17 </div>
18 <pre id="test">
19 <script type="application/javascript">
21 SimpleTest.waitForExplicitFinish();
23 var jsBig = new Image();
25 // We have loaded the large png with id "big". We want to test if it will be
26 // kicked out of the cache and thus have to be reloaded, but to ensure that, we
27 // need to get the cache to look at what is there. So we load another image,
28 // this one small.
29 function loadSmall()
31 // Trivial check, for reference.
32 is(document.getElementById("big").width, 3000,
33 "HTML 'big' image width after page onload()");
35 var small = new Image();
36 small.onload = smallLoaded;
37 small.src = "red.png";
40 function smallLoaded()
42 jsBig.src = document.getElementById("big").src;
43 // Check that it is not needed to wait for onload().
44 is(jsBig.width, 3000, "JS 'big' image width before its onload()");
45 // Check again after onload(), for reference.
46 jsBig.onload = jsBigLoaded;
49 function jsBigLoaded()
51 is(jsBig.width, 3000, "JS 'big' image width after its onload()");
53 SimpleTest.finish();
55 </script>
56 </pre>
57 </body>
58 </html>