Closed
Bug 737359
Opened 13 years ago
Closed 13 years ago
Add the Allow button for a non-whitelisted site to API
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: remus.pop, Assigned: vladmaniac)
References
Details
(Whiteboard: [lib])
Attachments
(1 file, 1 obsolete file)
|
2.18 KB,
patch
|
vladmaniac
:
review+
whimboo
:
review-
|
Details | Diff | Splinter Review |
This is the button that appears if we try to install an addon from a website that is not whitelisted.
We will need this for the AMO tests.
| Reporter | ||
Updated•13 years ago
|
Comment 1•13 years ago
|
||
Keep in mind that this is a doorhanger and should use the appropriate API from the toolbars module.
| Reporter | ||
Comment 2•13 years ago
|
||
Defined ADDON_BLOCKED_NOTIFICATION and added the allow button as a case in getElement method of locationBar in toolbars.js.
Attachment #607894 -
Flags: review?(vlad.mozbugs)
| Assignee | ||
Comment 3•13 years ago
|
||
Comment on attachment 607894 [details] [diff] [review]
patch v1 (all branches)
>+const ADDON_BLOCKED_NOTIFICATION = NOTIFICATION_POPUP +
>+ '/id("addon-install-blocked-notification")';
The indentation above does not match with the correct one below
Use below even if its a bit longer than the standard, its consistent with the API indentation
const ADDON_BLOCKED_NOTIFICATION = NOTIFICATION_POPUP + '/id("addon-install-blocked-notification")';
> const URLBAR_CONTAINER = '/id("main-window")/id("tab-view-deck")/[0]' +
> '/id("navigator-toolbox")/id("nav-bar")/id("urlbar-container")';
> const URLBAR_INPUTBOX = URLBAR_CONTAINER + '/id("urlbar")' +
> '/anon({"anonid":"textbox-container"})' +
> '/anon({"anonid":"textbox-input-box"})';
> const CONTEXT_MENU = URLBAR_INPUTBOX + '/anon({"anonid":"input-box-contextmenu"})';
>
> /**
>@@ -494,16 +496,23 @@ locationBar.prototype = {
> getElement : function locationBar_getElement(spec) {
> var elem = null;
>
> switch(spec.type) {
> /**
> * subtype: subtype to match
> * value: value to match
> */
>+ case "allowButton":
>+ elem = new elementslib.Lookup(this._controller.window.document,
>+ ADDON_BLOCKED_NOTIFICATION +
>+ '/anon([1])' +
>+ '/{"class":"popup-notification-button-container",' +
>+ '"pack":"end","align":"center"}/anon({"anonid":"button"})');
Same here
>+ break;
> case "contextMenu":
> elem = new elementslib.Lookup(this._controller.window.document, CONTEXT_MENU);
> break;
> case "contextMenu_entry":
> elem = new elementslib.Lookup(this._controller.window.document, CONTEXT_MENU +
> '/{"cmd":"cmd_' + spec.subtype + '"}');
> break;
> case "favicon":
With those changes you have my + and you can continue the review process by passing along to Henrik
Attachment #607894 -
Flags: review?(vlad.mozbugs) → review-
| Reporter | ||
Comment 4•13 years ago
|
||
Addressed all requests.
Attachment #607894 -
Attachment is obsolete: true
Attachment #607950 -
Flags: review?(vlad.mozbugs)
| Assignee | ||
Comment 5•13 years ago
|
||
Comment on attachment 607950 [details] [diff] [review]
patch v2 (all branches)
Looks good to me. Over to Henrik
Attachment #607950 -
Flags: review?(vlad.mozbugs)
Attachment #607950 -
Flags: review?(hskupin)
Attachment #607950 -
Flags: review+
Comment 6•13 years ago
|
||
Comment on attachment 607950 [details] [diff] [review]
patch v2 (all branches)
> const NOTIFICATION_POPUP = '/id("main-window")/id("mainPopupSet")/id("notification-popup")';
>+const ADDON_BLOCKED_NOTIFICATION = NOTIFICATION_POPUP + '/id("addon-install-blocked-notification")';
We do not want to have this as a constant here. Please remove it.
>+ case "allowButton":
>+ elem = new elementslib.Lookup(this._controller.window.document, ADDON_BLOCKED_NOTIFICATION +
>+ '/anon([1])/{"class":"popup-notification-button-container",' +
>+ '"pack":"end","align":"center"}/anon({"anonid":"button"})');
>+ break;
There is no need for a new entry in the elements definition. For now we do not want to support special elements in this class. Instead make use of the 'getNotificationElement' method on the locationBar class. If you want to wrap that, add a new function to the add-ons module.
Beside this, I would propose that we always whitelist the target site for our tests instead of handling this notification. A single test which handles this notification should be enough, but it shouldn't be one of the tests you are creating here for the AMO site. It can be a functional restart test. So I wouldn't see the necessity to create an API method at all.
Attachment #607950 -
Flags: review?(hskupin) → review-
| Reporter | ||
Comment 7•13 years ago
|
||
Henrik, we have several tests for AMO that would benefit from this change.
Comment 8•13 years ago
|
||
Which tests? As said, it should be enough to have a single test which really works with the notification bar.
Updated•13 years ago
|
Component: Mozmill Shared Modules → Mozmill Tests
Updated•13 years ago
|
Whiteboard: [lib]
| Reporter | ||
Comment 9•13 years ago
|
||
The tests are in work. I have 2 of them and Vlad has 1. There are more which the WebQA needs them, but I think it's ok to have one that uses this button.
Comment 10•13 years ago
|
||
Vlad, can you please check if the patch still applies and test with one of the tests we have?
Assignee: remus.pop → vlad.mozbugs
| Assignee | ||
Comment 11•13 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #10)
> Vlad, can you please check if the patch still applies and test with one of
> the tests we have?
Yes well comment 8 makes lots of sense to me.
We have been whitelisting the target site so far, and working with the notification in just one test seems really decent because all the tests are in the same manner, at least ones which are installing stuff from AMO.
IMHO this bug is WONTFIX. We don't want an API method if we use this only once, we can just use getNotificationElement with a lookup string to get the 'Allow' button
Comment 12•13 years ago
|
||
Alright. So all are in agreement here. Lets close it as Wontfix.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Updated•6 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
•