2012-05-19 23:42:23 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=733553
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 733553</title>
|
|
|
|
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
2012-09-07 02:05:27 +04:00
|
|
|
<body onload="initializeOnload()">
|
2012-05-19 23:42:23 +04:00
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=733553">Mozilla Bug 733553</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2012-09-07 02:05:27 +04:00
|
|
|
var testIndex = -1;
|
2012-05-19 23:42:23 +04:00
|
|
|
var testParts = [
|
|
|
|
[1, "red.png"],
|
|
|
|
[40, "animated-gif2.gif"],
|
|
|
|
[1, "red.png"],
|
|
|
|
[100, "lime100x100.svg"],
|
2012-09-07 02:05:27 +04:00
|
|
|
[100, "lime100x100.svg"],
|
2012-05-19 23:42:23 +04:00
|
|
|
[40, "animated-gif2.gif"],
|
2012-09-07 02:05:27 +04:00
|
|
|
[1, "red.png"],
|
|
|
|
[80, "damon.jpg"],
|
|
|
|
[80, "damon.jpg"],
|
|
|
|
[80, "damon.jpg"]
|
2012-05-19 23:42:23 +04:00
|
|
|
];
|
|
|
|
|
2012-08-29 05:23:22 +04:00
|
|
|
// We'll append the part number to this, and tell the informant
|
|
|
|
const BASE_URL = "bug733553-informant.sjs?";
|
|
|
|
|
2012-05-19 23:42:23 +04:00
|
|
|
function initializeOnload() {
|
2012-09-07 02:05:27 +04:00
|
|
|
var firstimg = document.createElement('img');
|
2012-05-19 23:42:23 +04:00
|
|
|
firstimg.addEventListener("load", imageLoad, false);
|
2012-09-07 02:05:27 +04:00
|
|
|
firstimg.addEventListener("error", imageLoad, false);
|
|
|
|
firstimg.src = "bug733553.sjs";
|
|
|
|
document.getElementById('content').appendChild(firstimg);
|
|
|
|
|
|
|
|
// Really ready for first, but who's counting
|
|
|
|
readyForNext();
|
2012-05-19 23:42:23 +04:00
|
|
|
}
|
|
|
|
|
2012-08-29 05:23:22 +04:00
|
|
|
function readyForNext() {
|
|
|
|
var loader = document.getElementById("loader");
|
2012-09-07 02:05:27 +04:00
|
|
|
loader.src = BASE_URL + ++testIndex;
|
2012-08-29 05:23:22 +04:00
|
|
|
}
|
|
|
|
|
2012-05-19 23:42:23 +04:00
|
|
|
function imageLoad(aEvent) {
|
|
|
|
if (testParts.length > testIndex) {
|
2012-08-29 05:23:22 +04:00
|
|
|
var [width, fileName] = testParts[testIndex];
|
2012-09-07 02:05:27 +04:00
|
|
|
is(aEvent.target.width, width,
|
|
|
|
"Test " + testIndex + " " + fileName + " width correct");
|
|
|
|
readyForNext();
|
2012-08-29 05:23:22 +04:00
|
|
|
} else {
|
|
|
|
aEvent.target.removeEventListener("load", imageLoad, false);
|
2012-09-07 02:05:27 +04:00
|
|
|
aEvent.target.removeEventListener("error", imageLoad, false);
|
2012-08-29 05:23:22 +04:00
|
|
|
var loader = document.getElementById("loader");
|
|
|
|
readyForNext();
|
2012-05-19 23:42:23 +04:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
<div id="content"> <!-- style="display: none" -->
|
2012-08-29 05:23:22 +04:00
|
|
|
<iframe id="loader"></iframe>
|
2012-05-19 23:42:23 +04:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|