Backed out changeset ebd79cd25bf5 (bug 815120) for mochitest-bc failures.

This commit is contained in:
Ryan VanderMeulen 2013-08-19 10:29:04 -04:00
parent 4a87e3b0c8
commit 5539d90177
2 changed files with 2 additions and 44 deletions

View File

@ -2085,9 +2085,6 @@ var gSearchView = {
this._emptyNotice = document.getElementById("search-list-empty");
this._allResultsLink = document.getElementById("search-allresults-link");
if (!AddonManager.isInstallEnabled("application/x-xpinstall"))
this._filter.hidden = true;
var self = this;
this._listBox.addEventListener("keydown", function listbox_onKeydown(aEvent) {
if (aEvent.keyCode == aEvent.DOM_VK_ENTER ||
@ -2229,10 +2226,6 @@ var gSearchView = {
updateView: function gSearchView_updateView() {
var showLocal = this._filter.value == "local";
if (!showLocal && !AddonManager.isInstallEnabled("application/x-xpinstall"))
showLocal = true;
this._listBox.setAttribute("local", showLocal);
this._listBox.setAttribute("remote", !showLocal);

View File

@ -335,10 +335,8 @@ function check_results(aQuery, aSortBy, aReverseOrder, aShowLocal) {
* How the results are sorted (e.g. "name")
* @param aReverseOrder
* Boolean representing if the results are in reverse default order
* @param aLocalOnly
* Boolean representing if the results are local only, can be undefined
*/
function check_filtered_results(aQuery, aSortBy, aReverseOrder, aLocalOnly) {
function check_filtered_results(aQuery, aSortBy, aReverseOrder) {
var localFilter = gManagerWindow.document.getElementById("search-filter-local");
var remoteFilter = gManagerWindow.document.getElementById("search-filter-remote");
@ -350,9 +348,8 @@ function check_filtered_results(aQuery, aSortBy, aReverseOrder, aLocalOnly) {
check_results(aQuery, aSortBy, aReverseOrder, true);
// Check with showing remote add-ons
aLocalOnly = aLocalOnly || false;
EventUtils.synthesizeMouseAtCenter(remoteFilter, { }, gManagerWindow);
check_results(aQuery, aSortBy, aReverseOrder, aLocalOnly);
check_results(aQuery, aSortBy, aReverseOrder, false);
}
/*
@ -650,35 +647,3 @@ add_test(function() {
});
});
function bug_815120_test_search(aLocalOnly) {
restart_manager(gManagerWindow, "addons://list/extension", function(aWindow) {
gManagerWindow = aWindow;
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
// Installed add-on is considered local on new search
gAddonInstalled = true;
// Check the search setup
if (aLocalOnly) {
var localFilterSelected = aWindow.document.getElementById("search-filter-local").selected;
ok(localFilterSelected, "Local filter should be selected if remote plugin installation is disabled");
}
var remoteFilterButton = aWindow.document.getElementById("search-filter-remote");
is(aLocalOnly, is_hidden(remoteFilterButton), "Remote filter button visibility does not match, aLocalOnly = " + aLocalOnly);
search(QUERY, false, function() {
check_filtered_results(QUERY, "relevancescore", false, aLocalOnly);
run_next_test();
});
});
}
// Tests for Bug 815120
add_test(function() {
Services.prefs.setBoolPref(PREF_XPI_ENABLED, false);
bug_815120_test_search(true);
});
add_test(function() {
Services.prefs.setBoolPref(PREF_XPI_ENABLED, true);
bug_815120_test_search(false);
});