Backed out changeset ebd79cd25bf5 (bug 815120) for mochitest-bc failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 19 Aug 2013 10:29:04 -0400
changeset 143064 ab1d6d80090eba98f105cc95b8c22df97a1d1846
parent 143063 ebd79cd25bf55b9c715c26be9e13a24a681d89e2
child 143065 3bcc3e774eee69e2325a98c2cc07f880dc81d498
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs815120
milestone26.0a1
backs outebd79cd25bf55b9c715c26be9e13a24a681d89e2
Backed out changeset ebd79cd25bf5 (bug 815120) for mochitest-bc failures.
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_searching.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2080,19 +2080,16 @@ var gSearchView = {
     this._filter = document.getElementById("search-filter-radiogroup");
     this._sorters = document.getElementById("search-sorters");
     this._sorters.handler = this;
     this._loading = document.getElementById("search-loading");
     this._listBox = document.getElementById("search-list");
     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 ||
           aEvent.keyCode == aEvent.DOM_VK_RETURN) {
         var item = self._listBox.selectedItem;
         if (item)
           item.showInDetailView();
       }
@@ -2224,20 +2221,16 @@ var gSearchView = {
   
   showLoading: function gSearchView_showLoading(aLoading) {
     this._loading.hidden = !aLoading;
     this._listBox.hidden = aLoading;
   },
 
   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);
 
     this.showLoading(this.isSearching && !showLocal);
     if (!this.isSearching) {
       var isEmpty = true;
       var results = this._listBox.getElementsByTagName("richlistitem");
       for (let result of results) {
--- a/toolkit/mozapps/extensions/test/browser/browser_searching.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_searching.js
@@ -330,34 +330,31 @@ function check_results(aQuery, aSortBy, 
  * Check results of a search with different filterings
  *
  * @param  aQuery
  *         The search query used
  * @param  aSortBy
  *         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");
 
   var list = gManagerWindow.document.getElementById("search-list");
   list.ensureElementIsVisible(localFilter);
 
   // Check with showing local add-ons
   EventUtils.synthesizeMouseAtCenter(localFilter, { }, gManagerWindow);
   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);
 }
 
 /*
  * Get item for a specific add-on by name
  *
  * @param  aName
  *         The name of the add-on to search for
  * @return Row of add-on if found, null otherwise
@@ -645,40 +642,8 @@ add_test(function() {
       var installBtn = get_install_button(get_addon_item(REMOTE_TO_INSTALL));
       is(installBtn.hidden, true, "Install button should be hidden for installed item");
 
       run_next_test();
     });
   });
 });
 
-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);
-});