Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Revert "Bug 871441 - Changed select method to handle xul:menulist. r=…
Browse files Browse the repository at this point in the history
…hskupin"

This reverts commit 095c73a.
  • Loading branch information
whimboo committed Jul 25, 2013
1 parent 095c73a commit 4878257
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 37 deletions.
12 changes: 7 additions & 5 deletions mozmill/mozmill/extension/resource/driver/mozelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,7 @@ MozMillDropList.prototype = Object.create(MozMillElement.prototype, {
// Unwrap the XUL element's XPCNativeWrapper
this.element = utils.unwrapNode(this.element);
// Get the list of menuitems
menuitems = this.element.
getElementsByTagNameNS(NAMESPACE_XUL, "menupopup")[0].
getElementsByTagNameNS(NAMESPACE_XUL, "menuitem");
menuitems = this.element.getElementsByTagName("menupopup")[0].getElementsByTagName("menuitem");

var item = null;

Expand Down Expand Up @@ -774,9 +772,13 @@ MozMillDropList.prototype = Object.create(MozMillElement.prototype, {

// Click the item
try {
this.element.click();
EventUtils.synthesizeMouse(this.element, 1, 1, {}, ownerDoc.defaultView);
utils.sleep(0);

item.scrollIntoView();
item.click();

EventUtils.synthesizeMouse(item, 1, 1, {}, ownerDoc.defaultView);
utils.sleep(0);

var self = this;
var selected = index || option || value;
Expand Down
32 changes: 0 additions & 32 deletions mutt/mutt/tests/js/elementslib/menulist.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,3 @@ var testChromeSelect = function () {
menulist.select(null, 'Missouri');
expect.equal(menulist.getNode().value, 'MO', "Value has been selected");
}

var testXULMenuList = function () {
controller.open("about:addons");
controller.waitForPageLoad();

// Open Plugins section and add an event listener to wait for the view to change
var self = { changed: false };
function onViewChanged() { self.changed = true; }
controller.window.document.addEventListener("ViewChanged",
onViewChanged, false);

var plugin = new elementslib.ID(controller.window.document, "category-plugin");
controller.click(plugin);

assert.waitFor(function () {
return self.changed;
}, "Category has been changed.");

// Select by option
var parent = controller.tabs.activeTab.querySelector(".addon.addon-view");
var node = controller.tabs.activeTab.
getAnonymousElementByAttribute(parent, "anonid", "state-menulist");
var menulist = new elementslib.Elem(node);

menulist.select(null, "Never Activate");
expect.equal(menulist.getNode().label, "Never Activate",
"Never activate value has been selected");

menulist.select(null, "Always Activate");
expect.equal(menulist.getNode().label, "Always Activate",
"Always activate value has been selected");
}

0 comments on commit 4878257

Please sign in to comment.