Bug 1261158 - Convert test_has_transparency.html to a mochitest-plain. r=tnikkel

MozReview-Commit-ID: 9tR3LH4wg4U
This commit is contained in:
Kartikaya Gupta 2016-04-04 16:27:58 -04:00
parent 4f6713a578
commit d278cd5ea7
3 changed files with 18 additions and 16 deletions

View File

@ -11,20 +11,13 @@ support-files =
damon.jpg
filter-final.svg
filter.svg
first-frame-padding.gif
ico-bmp-opaque.ico
ico-bmp-transparent.ico
iframe.html
imgutils.js
invalid.jpg
lime100x100.svg
opaque.bmp
red.gif
red.png
ref-iframe.html
rillybad.jpg
transparent.gif
transparent.png
bug1132427.html
bug1132427.gif
@ -36,7 +29,6 @@ disabled = bug 1101415
skip-if = os != "win" || os_version == "6.2"
support-files =
bug415761.ico
[test_has_transparency.html]
[test_net_failedtoprocess.html]
[test_removal_ondecode.html]
[test_removal_onload.html]

View File

@ -41,9 +41,12 @@ support-files =
clear2-results.gif
damon.jpg
error-early.png
first-frame-padding.gif
green.png
green-background.html
grey.png
ico-bmp-opaque.ico
ico-bmp-transparent.ico
imgutils.js
invalid.jpg
keep.gif
@ -51,7 +54,9 @@ support-files =
lime100x100.svg
lime-anim-100x100.svg
lime-anim-100x100-2.svg
opaque.bmp
purple.gif
red.gif
red.png
restore-previous.gif
restore-previous.png
@ -60,6 +65,8 @@ support-files =
shaver.png
short_header.gif
source.png
transparent.gif
transparent.png
over.png
6M-pixels.png
12M-pixels-1.png
@ -112,3 +119,5 @@ skip-if = buildapp == 'b2g' || os == 'android'
skip-if = buildapp == 'b2g' || os == 'android'
[test_changeOfSource2.html]
skip-if = buildapp == 'b2g' || os == 'android'
[test_has_transparency.html]
skip-if = buildapp == 'b2g' || os == 'android'

View File

@ -5,10 +5,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1089880
-->
<head>
<title>Test for Bug 1089880</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="imgutils.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1089880">Mozilla Bug 1089880</a>
@ -19,12 +19,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1089880
<script type="application/javascript;version=1.8">
/** Test for Bug 1089880 **/
SimpleTest.requestFlakyTimeout("Early failure timeout");
SimpleTest.waitForExplicitFinish();
const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes)
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;
const gContent = document.getElementById("content");
var gCanvas;
@ -124,7 +125,7 @@ function cleanUpAndFinish() {
return;
}
gIsTestFinished = true;
let imgLoadingContent = gImg.QueryInterface(Ci.nsIImageLoadingContent);
let imgLoadingContent = SpecialPowers.wrap(gImg).QueryInterface(Ci.nsIImageLoadingContent);
imgLoadingContent.removeObserver(gMyDecoderObserver);
SimpleTest.finish();
}
@ -143,8 +144,8 @@ function main() {
observer.decodeComplete = onDecodeComplete;
gMyDecoderObserver =
Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
.createScriptedObserver(observer);
let imgLoadingContent = gImg.QueryInterface(Ci.nsIImageLoadingContent);
.createScriptedObserver(SpecialPowers.wrapCallbackObject(observer));
let imgLoadingContent = SpecialPowers.wrap(gImg).QueryInterface(Ci.nsIImageLoadingContent);
imgLoadingContent.addObserver(gMyDecoderObserver);
// We want to test the cold loading behavior, so clear cache in case an