Bug 1103328 (Part 4) - Force decoding in test_has_transparency. r=tn

This commit is contained in:
Seth Fowler 2014-11-24 23:42:43 -08:00
parent 28d652639c
commit 113152d3b4

View File

@ -27,6 +27,8 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const gContent = document.getElementById("content");
var gCanvas;
var gCanvasCtx;
var gImg;
var gMyDecoderObserver;
var gIsTestFinished = false;
@ -99,6 +101,11 @@ function onLoad() {
return;
}
ok(true, "Should successfully load " + gImg.src);
// Force decoding of the image.
SimpleTest.executeSoon(function() {
gCanvasCtx.drawImage(gImg, 0, 0);
});
}
function failTest() {
@ -119,6 +126,8 @@ function cleanUpAndFinish() {
function main() {
gFiles = testFiles();
gCanvas = document.createElement('canvas');
gCanvasCtx = gCanvas.getContext('2d');
gImg = new Image();
gImg.onload = onLoad;
gImg.onerror = onError;