Bug 1163856 (Part 2) - Fix tests that depended on image load event timing. r=tn

This commit is contained in:
Seth Fowler 2015-06-25 17:10:05 -07:00
parent 420767db2e
commit 028ff94473
4 changed files with 21 additions and 11 deletions

View File

@ -52,8 +52,9 @@ skip-if = e10s # scratchpad.xul is not loading in e10s window
[browser_markupview_events.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markupview_events_form.js]
[browser_markupview_events-overflow.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
# [browser_markupview_events-overflow.js]
# skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
# disabled - See bug 1177550
[browser_markupview_events_jquery_1.0.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markupview_events_jquery_1.1.js]

View File

@ -13,6 +13,7 @@ observer event with the nsIURI of the failed image as the subject
<body>
<p id="display"></p>
<pre id="test">
</pre>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
@ -43,9 +44,9 @@ var observer = {
obs.addObserver(observer, "net:failed-to-process-uri-content", false);
document.write('<img src="damon.jpg">');
document.write('<img src="invalid.jpg">');
</script>
</pre>
<img src="damon.jpg">
<img src="invalid.jpg">
</body>
</html>

View File

@ -23,10 +23,14 @@
canvas.toBlob(function(blob) {
var uri = window.URL.createObjectURL(blob);
uri += '#-moz-samplesize=8';
document.getElementById('test').src = uri;
var testImage = document.getElementById('test');
// Take the snapshot.
document.documentElement.removeAttribute('class');
testImage.onload = testImage.onerror = function() {
// Take the snapshot.
document.documentElement.removeAttribute('class');
};
testImage.src = uri;
}, 'image/jpeg', 0.99);
}

View File

@ -22,10 +22,14 @@
// Convert the image into a blob URI and use it as #test's src.
canvas.toBlob(function(blob) {
var uri = window.URL.createObjectURL(blob);
document.getElementById('test').src = uri;
var testImage = document.getElementById('test');
testImage.onload = testImage.onerror = function() {
// Take the snapshot.
document.documentElement.removeAttribute('class');
};
// Take the snapshot.
document.documentElement.removeAttribute('class');
testImage.src = uri;
}, 'image/jpeg', 0.99);
}