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)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: remus.pop, Assigned: vladmaniac)

References

Details

(Whiteboard: [lib])

Attachments

(1 file, 1 obsolete file)

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.
Blocks: 732913, 733367, 732357
Keep in mind that this is a doorhanger and should use the appropriate API from the toolbars module.
Attached patch patch v1 (all branches) (obsolete) — Splinter Review
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)
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-
Addressed all requests.
Attachment #607894 - Attachment is obsolete: true
Attachment #607950 - Flags: review?(vlad.mozbugs)
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 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-
Henrik, we have several tests for AMO that would benefit from this change.
Which tests? As said, it should be enough to have a single test which really works with the notification bar.
Component: Mozmill Shared Modules → Mozmill Tests
Whiteboard: [lib]
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.
Vlad, can you please check if the patch still applies and test with one of the tests we have?
Assignee: remus.pop → vlad.mozbugs
(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
Alright. So all are in agreement here. Lets close it as Wontfix.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: