Closed Bug 1693022 Opened 3 years ago Closed 3 years ago

"Addon:Uninstall" does not fail for unknown add-on ids

Categories

(Remote Protocol :: Marionette, defect, P3)

Default
defect

Tracking

(firefox87 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: Dexter, Assigned: Dexter)

Details

Attachments

(1 file)

I'm writing an integration test using Selenium and Firefox (through the geckodriver), in JavaScript. I'm installing an addon using driver.installAddon and uninstalling it using uninstallAddon.

It seems that uninstallAddon never fails, even if the addon to be uninstalled is not there. Is this a bug?

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #1)

I wonder what AddonManager.getAddonByID() actually returns in such a case. Here it's implementation:
https://searchfox.org/mozilla-central/rev/a23e65c5d69a821f61d14c8ec1f69a120e3f77d1/toolkit/mozapps/extensions/AddonManager.jsm#2687

It seems to return null in that case: using the script directly in the "chrome" context works fine!

Oh, so our Promise handling is broken given that we do not catch the failure when accessing candidate.uninstall().

So I would suggest to use await and then also a null check.

The AddonManager does not throw, but instead reports null, when
trying to get information about an addon if the id is unknown.
This makes sure marionette addresses this case.

Assignee: nobody → alessio.placitelli
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cbd7229f4587
Report errors when uninstalling unknown addons in marionette. r=whimboo,marionette-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Summary: `webdriver.uninstallAddon` does not fail for unknown ids → "Addon:Uninstall" does not fail for unknown add-on ids
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: