Bug 819412 - Test for
Bug 733553 gets desynched under load r=joe
--- a/image/test/mochitest/test_bug733553.html
+++ b/image/test/mochitest/test_bug733553.html
@@ -64,17 +64,20 @@ function readyForNext() {
function imageLoad(aEvent) {
var [width, fileName] = testParts[testIndex];
is(aEvent.target.width, width,
"Test " + testIndex + " " + fileName + " width correct");
// Always call readyForNext here, as it's the closest we have to a cleanup
readyForNext();
- if ((testParts.length - 1) == testIndex) {
+ if (testParts.length == testIndex) {
+ var firstimg = document.getElementsByTagName('img')[0];
+ firstimg.removeEventListener("load", imageLoad, false);
+ firstimg.removeEventListener("error", imageLoad, false);
SimpleTest.finish();
}
}
</script>
</pre>
<div id="content"> <!-- style="display: none" -->
<iframe id="loader"></iframe>