Backed out changeset 95067eec6bde (bug 815120) for mochitest-bc failures

This commit is contained in:
Tim Taubert 2013-04-25 09:42:54 +02:00
parent 40f827595f
commit e662ba5969
2 changed files with 2 additions and 43 deletions

View File

@ -2042,12 +2042,6 @@ var gSearchView = {
this._emptyNotice = document.getElementById("search-list-empty");
this._allResultsLink = document.getElementById("search-allresults-link");
if (!AddonManager.isInstallEnabled("application/x-xpinstall")) {
var remote = document.getElementById("search-filter-remote");
remote.hidden = true;
this._filter.selectedIndex = 0; // Search in local addons
}
var self = this;
this._listBox.addEventListener("keydown", function listbox_onKeydown(aEvent) {
if (aEvent.keyCode == aEvent.DOM_VK_ENTER ||

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);
});