Bug 1261158 - Convert test_removal_onload.html to a mochitest-plain. r=tnikkel a=test-only

MozReview-Commit-ID: DL4IQaUl7t5
This commit is contained in:
Kartikaya Gupta 2016-04-04 16:28:12 -04:00
parent 337156937e
commit ff58440a32
3 changed files with 11 additions and 14 deletions

View File

@ -7,16 +7,11 @@ support-files =
animated2.gif animated2.gif
animation.svg animation.svg
animationPolling.js animationPolling.js
bad.jpg
filter-final.svg filter-final.svg
filter.svg filter.svg
iframe.html iframe.html
imgutils.js imgutils.js
invalid.jpg
lime100x100.svg
red.png
ref-iframe.html ref-iframe.html
rillybad.jpg
bug1132427.html bug1132427.html
bug1132427.gif bug1132427.gif
@ -28,7 +23,6 @@ disabled = bug 1101415
skip-if = os != "win" || os_version == "6.2" skip-if = os != "win" || os_version == "6.2"
support-files = support-files =
bug415761.ico bug415761.ico
[test_removal_onload.html]
[test_staticClone.html] [test_staticClone.html]
[test_svg_animatedGIF.html] [test_svg_animatedGIF.html]
[test_svg_filter_animation.html] [test_svg_filter_animation.html]

View File

@ -131,3 +131,5 @@ skip-if = buildapp == 'b2g' || os == 'android'
skip-if = buildapp == 'b2g' || os == 'android' skip-if = buildapp == 'b2g' || os == 'android'
[test_removal_ondecode.html] [test_removal_ondecode.html]
skip-if = buildapp == 'b2g' || os == 'android' skip-if = buildapp == 'b2g' || os == 'android'
[test_removal_onload.html]
skip-if = buildapp == 'b2g' || os == 'android'

View File

@ -5,10 +5,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=841579
--> -->
<head> <head>
<title>Test for Bug 841579</title> <title>Test for Bug 841579</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> <script type="application/javascript" src="/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/WindowSnapshot.js"></script>
<script type="application/javascript" src="imgutils.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> </head>
<body> <body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=841579">Mozilla Bug 841579</a> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=841579">Mozilla Bug 841579</a>
@ -19,12 +19,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=841579
<script type="application/javascript;version=1.8"> <script type="application/javascript;version=1.8">
/** Test for Bug 841579**/ /** Test for Bug 841579**/
SimpleTest.requestFlakyTimeout("Early failure timeout");
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes) const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes)
const Cc = Components.classes; const Cc = SpecialPowers.Cc;
const Ci = Components.interfaces; const Ci = SpecialPowers.Ci;
const gContent = document.getElementById("content"); const gContent = document.getElementById("content");
var gImg; var gImg;
@ -82,7 +83,7 @@ function cleanUpAndFinish() {
if (gIsTestFinished) { if (gIsTestFinished) {
return; return;
} }
let imgLoadingContent = gImg.QueryInterface(Ci.nsIImageLoadingContent); let imgLoadingContent = SpecialPowers.wrap(gImg).QueryInterface(Ci.nsIImageLoadingContent);
imgLoadingContent.removeObserver(gMyDecoderObserver); imgLoadingContent.removeObserver(gMyDecoderObserver);
// TODO: this isn't the case until post-bug 716140's refactorings // TODO: this isn't the case until post-bug 716140's refactorings
// ok(gNotifications == gLoads, "Should be notified the same number of times as loads"); // ok(gNotifications == gLoads, "Should be notified the same number of times as loads");
@ -103,8 +104,8 @@ function main() {
observer.decodeComplete = onDecodeComplete; observer.decodeComplete = onDecodeComplete;
gMyDecoderObserver = gMyDecoderObserver =
Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
.createScriptedObserver(observer); .createScriptedObserver(SpecialPowers.wrapCallbackObject(observer));
let imgLoadingContent = gImg.QueryInterface(Ci.nsIImageLoadingContent); let imgLoadingContent = SpecialPowers.wrap(gImg).QueryInterface(Ci.nsIImageLoadingContent);
imgLoadingContent.addObserver(gMyDecoderObserver); imgLoadingContent.addObserver(gMyDecoderObserver);
// We want to test the cold loading behavior, so clear cache in case an // We want to test the cold loading behavior, so clear cache in case an