Closed
Bug 687450
Opened 13 years ago
Closed 13 years ago
Add back-end method to enable and disable add-ons
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: AlexLakatos, Assigned: AlexLakatos)
References
Details
(Whiteboard: [lib])
Attachments
(1 file, 3 obsolete files)
2.50 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
Add an enablePlugin() method to addons.js that uses back-end code and does not use the UI.
Needed for the teardownModule in bug 674221.
Assignee | ||
Updated•13 years ago
|
Assignee | ||
Comment 1•13 years ago
|
||
Added enablePlugin that uses the AddonManager component and can be called from outside the AddonsManager tab.
Attachment #560935 -
Flags: review?(hskupin)
Comment 2•13 years ago
|
||
Comment on attachment 560935 [details] [diff] [review]
patch v1.0
Methods in APIs should be able to be used more widely. So it's not only about plugins but all add-ons. Further you probably also want to disable add-ons via the backend. All that should be taken care in this helper method. Also this method is working asynchronously, so we need a way of synching.
Attachment #560935 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 3•13 years ago
|
||
Henrik, Anthony, do you guys have any tips for synching this? Should I use some sort of waitFor?
Comment 4•13 years ago
|
||
Use a local variable inside the method which is set to false at the beginning. Once the plugin callback has been executed set it to true from inside the callback. Now a waitFor call has to take place to wait for completion.
Updated•13 years ago
|
Summary: Add an enablePlugin() method to addons.js → Add an enableAddon() method to addons.js
Comment 5•13 years ago
|
||
The method has synchronisation now and has been renamed.
Attachment #560935 -
Attachment is obsolete: true
Attachment #564794 -
Flags: review?(hskupin)
Comment 6•13 years ago
|
||
We should not only have a method for enabling an add-on but also for disabling it.
Summary: Add an enableAddon() method to addons.js → Add back-end method to enable and disable add-ons
Comment 7•13 years ago
|
||
Comment on attachment 564794 [details] [diff] [review]
patch v2
>+function enableAddon(aAddonId) {
>+ addonIsEnabled = false;
You forgot 'var' or 'let' when declaring the variable. If you don't specify that it will become a global variable instead. Also it could be named as 'finished'. It will make it easier when we have mulitple of those helper functions. In that case I wonder if we could have an internal method we could use for synchronization.
>+ mozmill.utils.waitFor(function () {
>+ return addonIsEnabled;
>+ }, "Addon is enabled");
>+}
Please check the indentation and add the addon id to it for better debugging purposes.
Attachment #564794 -
Flags: review?(hskupin) → review-
Comment 8•13 years ago
|
||
Updated and created a disableAddon method.
Attachment #564794 -
Attachment is obsolete: true
Attachment #566176 -
Flags: review?(hskupin)
Comment 9•13 years ago
|
||
Comment on attachment 566176 [details] [diff] [review]
patch v3
>+ mozmill.utils.waitFor(function () {
>+ return finished;
>+ }, "Addon is enabled - expected ID - " + aAddonId);
nit: please fix the indentation inside the callback. Also the message should say: "Add-on 'XYZ' has been disabled". Keep an eye on disabled and not enabled. Looks like you missed to change it when copying and pasting code.
Same applies to the enableAddon function.
Attachment #566176 -
Flags: review?(hskupin) → review-
Comment 10•13 years ago
|
||
Addressed all issues.
Attachment #566176 -
Attachment is obsolete: true
Attachment #566201 -
Flags: review?(hskupin)
Updated•13 years ago
|
Attachment #566201 -
Flags: review?(hskupin) → review+
Comment 11•13 years ago
|
||
Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/a71cb755c29b (default)
http://hg.mozilla.org/qa/mozmill-tests/rev/0524c582ebdd (aurora)
http://hg.mozilla.org/qa/mozmill-tests/rev/5eafb50ab61c (beta)
http://hg.mozilla.org/qa/mozmill-tests/rev/eab89a226b5c (release)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Component: Mozmill Shared Modules → Mozmill Tests
Updated•13 years ago
|
Whiteboard: [lib]
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•