author Benoit Girard <>
Tue, 16 Jul 2013 16:17:18 -0400
changeset 154501 b5319d82251e332db56a65a778f8b159511eb5ac
parent 87555 c1fd381a7faa4bb3bfe606bebcdd1c0a0fc8ef74
child 528457 c9c0c6f2eed54a187e124942e53c3660b4cf17d8
permissions -rw-r--r--
Bug 873378 - Add a limit on mobile of 20 layers per container layer. r=roc

  <title>Test for Bug 466586</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>

<body onload="loadSmall();">
<a target="_blank" href="">Mozilla Bug 466586</a>
<p id="display"></p>
<div id="content" style="display: none">
  <img id="big" src="big.png"/>
<pre id="test">
<script type="application/javascript">


var jsBig = new Image();

// We have loaded the large png with id "big". We want to test if it will be
// kicked out of the cache and thus have to be reloaded, but to ensure that, we
// need to get the cache to look at what is there. So we load another image,
// this one small.
function loadSmall()
  // Trivial check, for reference.
  is(document.getElementById("big").width, 3000,
     "HTML 'big' image width after page onload()");

  var small = new Image();
  small.onload = smallLoaded;
  small.src = "red.png";

function smallLoaded()
  jsBig.src = document.getElementById("big").src;
  // Check that it is not needed to wait for onload().
  is(jsBig.width, 3000, "JS 'big' image width before its onload()");
  // Check again after onload(), for reference.
  jsBig.onload = jsBigLoaded;

function jsBigLoaded()
  is(jsBig.width, 3000, "JS 'big' image width after its onload()");