summaryrefslogtreecommitdiffstats
path: root/image/test/mochitest/test_bug466586.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /image/test/mochitest/test_bug466586.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'image/test/mochitest/test_bug466586.html')
-rw-r--r--image/test/mochitest/test_bug466586.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/image/test/mochitest/test_bug466586.html b/image/test/mochitest/test_bug466586.html
new file mode 100644
index 000000000..cf34bb783
--- /dev/null
+++ b/image/test/mochitest/test_bug466586.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=466586
+-->
+<head>
+ <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"/>
+</head>
+
+<body onload="loadSmall();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=89419">Mozilla Bug 466586</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+ <img id="big" src="big.png"/>
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+SimpleTest.waitForExplicitFinish();
+
+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()");
+
+ SimpleTest.finish();
+}
+</script>
+</pre>
+</body>
+</html>