"Addon:Uninstall" does not fail for unknown add-on ids
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(firefox87 fixed)
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?
Comment 1•3 years ago
|
||
The method is implemented here:
https://searchfox.org/mozilla-central/rev/a23e65c5d69a821f61d14c8ec1f69a120e3f77d1/testing/marionette/addon.js#109-134
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
Assignee | ||
Comment 2•3 years ago
|
||
(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!
Comment 3•3 years ago
|
||
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.
Assignee | ||
Comment 4•3 years ago
|
||
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.
Updated•3 years ago
|
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
Comment 6•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•7 months ago
|
Description
•