From b53e08b713e0f9e9d2770a0dbdaf7390c8974232 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Sun, 3 Mar 2024 09:09:10 +0000 Subject: [PATCH] Bug 1864896: Autofix unused function arguments (image). r=tnikkel Differential Revision: https://phabricator.services.mozilla.com/D202968 --- image/test/browser/browser_bug666317.js | 4 ++-- ...r_offscreen_image_in_out_of_process_iframe.js | 16 ++++++++-------- image/test/mochitest/imgutils.js | 16 ++++++++-------- image/test/mochitest/test_animSVGImage2.html | 2 +- .../test/mochitest/test_animation_operators.html | 2 +- image/test/mochitest/test_bug601470.html | 2 +- .../test_discardFinishedAnimatedImage.html | 2 +- image/test/mochitest/test_has_transparency.html | 4 ++-- .../test/mochitest/test_net_failedtoprocess.html | 2 +- image/test/mochitest/test_removal_ondecode.html | 4 ++-- image/test/mochitest/test_removal_onload.html | 6 +++--- image/test/unit/async_load_tests.js | 10 +++++----- image/test/unit/image_load_helpers.js | 6 +++--- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/image/test/browser/browser_bug666317.js b/image/test/browser/browser_bug666317.js index 7f58c61c5633..5d039575c82b 100644 --- a/image/test/browser/browser_bug666317.js +++ b/image/test/browser/browser_bug666317.js @@ -15,11 +15,11 @@ var gScriptedObserver; var gClonedRequest; function ImageObserver(decodeCallback, discardCallback) { - this.decodeComplete = function onDecodeComplete(aRequest) { + this.decodeComplete = function onDecodeComplete() { decodeCallback(); }; - this.discard = function onDiscard(request) { + this.discard = function onDiscard() { if (!gWaitingForDiscard) { return; } diff --git a/image/test/browser/browser_offscreen_image_in_out_of_process_iframe.js b/image/test/browser/browser_offscreen_image_in_out_of_process_iframe.js index 363f7016394b..346413b6022f 100644 --- a/image/test/browser/browser_offscreen_image_in_out_of_process_iframe.js +++ b/image/test/browser/browser_offscreen_image_in_out_of_process_iframe.js @@ -75,14 +75,14 @@ add_task(async function () { // Returns the count of frameUpdate during |time| (in ms) period. async function observeFrameUpdate(time) { function ImageDecoderObserverStub() { - this.sizeAvailable = function sizeAvailable(aRequest) {}; - this.frameComplete = function frameComplete(aRequest) {}; - this.decodeComplete = function decodeComplete(aRequest) {}; - this.loadComplete = function loadComplete(aRequest) {}; - this.frameUpdate = function frameUpdate(aRequest) {}; - this.discard = function discard(aRequest) {}; - this.isAnimated = function isAnimated(aRequest) {}; - this.hasTransparency = function hasTransparency(aRequest) {}; + this.sizeAvailable = function sizeAvailable() {}; + this.frameComplete = function frameComplete() {}; + this.decodeComplete = function decodeComplete() {}; + this.loadComplete = function loadComplete() {}; + this.frameUpdate = function frameUpdate() {}; + this.discard = function discard() {}; + this.isAnimated = function isAnimated() {}; + this.hasTransparency = function hasTransparency() {}; } // Start from the callback of setTimeout. diff --git a/image/test/mochitest/imgutils.js b/image/test/mochitest/imgutils.js index b16ad1d065e3..e7e696f7688a 100644 --- a/image/test/mochitest/imgutils.js +++ b/image/test/mochitest/imgutils.js @@ -126,12 +126,12 @@ function getImagePref(pref) { // JS implementation of imgIScriptedNotificationObserver with stubs for all of its methods. function ImageDecoderObserverStub() { - this.sizeAvailable = function sizeAvailable(aRequest) {}; - this.frameComplete = function frameComplete(aRequest) {}; - this.decodeComplete = function decodeComplete(aRequest) {}; - this.loadComplete = function loadComplete(aRequest) {}; - this.frameUpdate = function frameUpdate(aRequest) {}; - this.discard = function discard(aRequest) {}; - this.isAnimated = function isAnimated(aRequest) {}; - this.hasTransparency = function hasTransparency(aRequest) {}; + this.sizeAvailable = function sizeAvailable() {}; + this.frameComplete = function frameComplete() {}; + this.decodeComplete = function decodeComplete() {}; + this.loadComplete = function loadComplete() {}; + this.frameUpdate = function frameUpdate() {}; + this.discard = function discard() {}; + this.isAnimated = function isAnimated() {}; + this.hasTransparency = function hasTransparency() {}; } diff --git a/image/test/mochitest/test_animSVGImage2.html b/image/test/mochitest/test_animSVGImage2.html index 0f3ae046c5c7..11972bdb365c 100644 --- a/image/test/mochitest/test_animSVGImage2.html +++ b/image/test/mochitest/test_animSVGImage2.html @@ -55,7 +55,7 @@ function takeReferenceSnapshot() { "reference div should disappear when it becomes display:none"); } -function myOnFrameUpdate(aRequest) { +function myOnFrameUpdate() { if (gIsTestFinished) { return; } diff --git a/image/test/mochitest/test_animation_operators.html b/image/test/mochitest/test_animation_operators.html index 2d3a6f6d6764..2ccd4a7de574 100644 --- a/image/test/mochitest/test_animation_operators.html +++ b/image/test/mochitest/test_animation_operators.html @@ -101,7 +101,7 @@ function startTest(i) element.setAttribute("scrolling", "no"); element.src = url; document.body.appendChild(element); - function handleLoad(event) + function handleLoad() { iframe.loaded = true; if (iframe == reference) { diff --git a/image/test/mochitest/test_bug601470.html b/image/test/mochitest/test_bug601470.html index fdf2d074f858..c4b772c877b7 100644 --- a/image/test/mochitest/test_bug601470.html +++ b/image/test/mochitest/test_bug601470.html @@ -26,7 +26,7 @@ window.onload = function() { .getService(SpecialPowers.Ci.nsIMemoryReporterManager); var amount = 0; - var handleReport = function(aProcess, aPath, aKind, aUnits, aAmount, aDesc) { + var handleReport = function(aProcess, aPath, aKind, aUnits, aAmount) { amount += aAmount; } diff --git a/image/test/mochitest/test_discardFinishedAnimatedImage.html b/image/test/mochitest/test_discardFinishedAnimatedImage.html index 190cb1d1a021..f5b7a94e3518 100644 --- a/image/test/mochitest/test_discardFinishedAnimatedImage.html +++ b/image/test/mochitest/test_discardFinishedAnimatedImage.html @@ -129,7 +129,7 @@ function addCallbacks(anImage) { imgLoadingContent.addObserver(scriptedObserver); } -function removeObserver(anImage) { +function removeObserver() { imgLoadingContent.removeObserver(scriptedObserver); } diff --git a/image/test/mochitest/test_has_transparency.html b/image/test/mochitest/test_has_transparency.html index 482aaf96b97f..cec8edfe7874 100644 --- a/image/test/mochitest/test_has_transparency.html +++ b/image/test/mochitest/test_has_transparency.html @@ -80,11 +80,11 @@ function loadNext() { gImg.setAttribute("src", currentFile); } -function onHasTransparency(aRequest) { +function onHasTransparency() { gHasTransparencyWasCalled = true; } -function onDecodeComplete(aRequest) { +function onDecodeComplete() { if (!gCurrentFileIsTransparent) { ok(!gHasTransparencyWasCalled, "onHasTransparency was not called for non-transparent file " + gImg.src); diff --git a/image/test/mochitest/test_net_failedtoprocess.html b/image/test/mochitest/test_net_failedtoprocess.html index 95ab5c0cc3e7..5d731f22341c 100644 --- a/image/test/mochitest/test_net_failedtoprocess.html +++ b/image/test/mochitest/test_net_failedtoprocess.html @@ -30,7 +30,7 @@ var observer = { throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE); }, - observe(subject, topic, data) { + observe(subject, topic) { ok(topic == "net:failed-to-process-uri-content", "wrong topic"); subject = subject.QueryInterface(Ci.nsIURI); is(subject.asciiSpec, `${location.origin}/tests/image/test/mochitest/invalid.jpg`, "wrong subject"); diff --git a/image/test/mochitest/test_removal_ondecode.html b/image/test/mochitest/test_removal_ondecode.html index 4ce7555757a8..b764c8e2edbc 100644 --- a/image/test/mochitest/test_removal_ondecode.html +++ b/image/test/mochitest/test_removal_ondecode.html @@ -45,7 +45,7 @@ function* fileToLoad() { yield "rillybad.jpg"; } -function onSizeAvailable(aRequest) { +function onSizeAvailable() { ok(true, "AfterLoad.onSizeAvailable called for " + gImg.src); } function onLoadComplete(aRequest) { @@ -68,7 +68,7 @@ function onLoadComplete(aRequest) { } } -function onDecodeComplete(aRequest) { +function onDecodeComplete() { ok(gExpected > gRemovals, "AfterLoad.onDecodeComplete called for " + gImg.src); SimpleTest.executeSoon(function() { try { diff --git a/image/test/mochitest/test_removal_onload.html b/image/test/mochitest/test_removal_onload.html index 0a060542f55b..288b987f2ed2 100644 --- a/image/test/mochitest/test_removal_onload.html +++ b/image/test/mochitest/test_removal_onload.html @@ -45,10 +45,10 @@ function* fileToLoad() { yield "rillybad.jpg"; } -function onSizeAvailable(aRequest) { +function onSizeAvailable() { ok(true, "AfterLoad.onSizeAvailable called for " + gImg.src); } -function onLoadComplete(aRequest) { +function onLoadComplete() { ok(gExpected > gLoads, "AfterLoad.onLoadComplete called for " + gImg.src); gLoads++; SimpleTest.executeSoon(function() { @@ -60,7 +60,7 @@ function onLoadComplete(aRequest) { maybeAdvance(); }); } -function onDecodeComplete(aRequest) { +function onDecodeComplete() { ok(true, "AfterLoad.onDecodeComplete called for " + gImg.src); } diff --git a/image/test/unit/async_load_tests.js b/image/test/unit/async_load_tests.js index f19e1463146b..1fdbe590e324 100644 --- a/image/test/unit/async_load_tests.js +++ b/image/test/unit/async_load_tests.js @@ -50,7 +50,7 @@ function checkClone(other_listener, aRequest) { // For as long as clone notification is synchronous, we can't test the clone state reliably. var listener = new ImageListener( null, - function (foo, bar) { + function () { do_test_finished(); } /* getCloneStopCallback(other_listener)*/ ); @@ -63,7 +63,7 @@ function checkClone(other_listener, aRequest) { } // Ensure that all the callbacks were called on aRequest. -function checkSizeAndLoad(listener, aRequest) { +function checkSizeAndLoad(listener) { Assert.notEqual(listener.state & SIZE_AVAILABLE, 0); Assert.notEqual(listener.state & LOAD_COMPLETE, 0); @@ -127,7 +127,7 @@ function checkSecondLoad() { listener.synchronous = false; } -function firstLoadDone(oldlistener, aRequest) { +function firstLoadDone() { checkSecondLoad(uri); do_test_finished(); @@ -136,7 +136,7 @@ function firstLoadDone(oldlistener, aRequest) { // Return a closure that allows us to check the stream listener's status when the // image finishes loading. function getChannelLoadImageStopCallback(streamlistener, next) { - return function channelLoadStop(imglistener, aRequest) { + return function channelLoadStop() { next(); do_test_finished(); @@ -216,7 +216,7 @@ function startImageCallback(otherCb) { return function (listener, request) { // Make sure we can load the same image immediately out of the cache. do_test_pending(); - var listener2 = new ImageListener(null, function (foo, bar) { + var listener2 = new ImageListener(null, function () { do_test_finished(); }); var outer = Cc["@mozilla.org/image/tools;1"] diff --git a/image/test/unit/image_load_helpers.js b/image/test/unit/image_load_helpers.js index 6d1e605bf528..3a97db00ca0e 100644 --- a/image/test/unit/image_load_helpers.js +++ b/image/test/unit/image_load_helpers.js @@ -31,12 +31,12 @@ function ImageListener(start_callback, stop_callback) { this.start_callback(this, aRequest); } }; - this.frameComplete = function onFrameComplete(aRequest) { + this.frameComplete = function onFrameComplete() { Assert.ok(!this.synchronous); this.state |= FRAME_COMPLETE; }; - this.decodeComplete = function onDecodeComplete(aRequest) { + this.decodeComplete = function onDecodeComplete() { Assert.ok(!this.synchronous); this.state |= DECODE_COMPLETE; @@ -50,7 +50,7 @@ function ImageListener(start_callback, stop_callback) { this.stop_callback(this, aRequest); } }; - this.frameUpdate = function onFrameUpdate(aRequest) {}; + this.frameUpdate = function onFrameUpdate() {}; this.isAnimated = function onIsAnimated() {}; // Initialize the synchronous flag to true to start. This must be set to