Backed out changeset 525f1fb9501e (bug 1453589) for ES lint failure in /builds/worker/checkouts/gecko/browser/components/preferences/in-content/tests/siteData/head.js on a CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Thu, 19 Apr 2018 16:57:30 +0300
changeset 468084 268e499a9da807f3eb9a11ae14a10c68184b5b77
parent 468083 a78bc7ff3de5a0ea4aea060731253fed63a59d00
child 468085 1f7eb198c7e1590d1a4801906f93c0014a094e72
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1453589
milestone61.0a1
backs out525f1fb9501e36f69a8d5b7fbfbeb62335ec6d73
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 525f1fb9501e (bug 1453589) for ES lint failure in /builds/worker/checkouts/gecko/browser/components/preferences/in-content/tests/siteData/head.js on a CLOSED TREE
browser/components/preferences/in-content/tests/siteData/browser_siteData2.js
browser/components/preferences/in-content/tests/siteData/browser_siteData_multi_select.js
browser/components/preferences/in-content/tests/siteData/head.js
browser/components/preferences/siteDataSettings.js
--- a/browser/components/preferences/in-content/tests/siteData/browser_siteData2.js
+++ b/browser/components/preferences/in-content/tests/siteData/browser_siteData2.js
@@ -205,26 +205,24 @@ add_task(async function() {
   assertSitesListed(doc, fakeHosts.slice(2));
 
   await mockSiteDataManager.unregister();
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   function removeSelectedSite(hosts) {
     frameDoc = win.gSubDialog._topDialog._frame.contentDocument;
     let removeBtn = frameDoc.getElementById("removeSelected");
-    is(removeBtn.disabled, true, "Should start with disabled removeSelected button");
     let sitesList = frameDoc.getElementById("sitesList");
     hosts.forEach(host => {
       let site = sitesList.querySelector(`richlistitem[host="${host}"]`);
       if (site) {
         site.click();
-        let currentSelectedIndex = sitesList.selectedIndex;
         is(removeBtn.disabled, false, "Should enable the removeSelected button");
         removeBtn.doCommand();
-        is(sitesList.selectedIndex, currentSelectedIndex);
+        is(removeBtn.disabled, true, "Should disable the removeSelected button");
       } else {
         ok(false, `Should not select and remove inexistent site of ${host}`);
       }
     });
   }
 });
 
 // Test searching and then removing only visible sites
--- a/browser/components/preferences/in-content/tests/siteData/browser_siteData_multi_select.js
+++ b/browser/components/preferences/in-content/tests/siteData/browser_siteData_multi_select.js
@@ -45,34 +45,34 @@ add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
   await updatePromise;
   await openSiteDataSettingsDialog();
 
   let doc = gBrowser.selectedBrowser.contentDocument;
 
   // Test the initial state
   assertSitesListed(doc, fakeHosts);
-  let win = gBrowser.selectedBrowser.contentWindow;
-  let frameDoc = win.gSubDialog._topDialog._frame.contentDocument;
-  let removeBtn = frameDoc.getElementById("removeSelected");
-  is(removeBtn.disabled, true, "Should start with disabled removeSelected button");
 
   let removeDialogOpenPromise = BrowserTestUtils.promiseAlertDialogOpen("accept", REMOVE_DIALOG_URL);
   let settingsDialogClosePromise = promiseSettingsDialogClose();
 
+  let win = gBrowser.selectedBrowser.contentWindow;
+  let frameDoc = win.gSubDialog._topDialog._frame.contentDocument;
+
   // Select some sites to remove.
   let sitesList = frameDoc.getElementById("sitesList");
   fakeHosts.slice(0, 2).forEach(host => {
     let site = sitesList.querySelector(`richlistitem[host="${host}"]`);
     sitesList.addItemToSelection(site);
   });
 
+  let removeBtn = frameDoc.getElementById("removeSelected");
   is(removeBtn.disabled, false, "Should enable the removeSelected button");
   removeBtn.doCommand();
-  is(sitesList.selectedIndex, 0, "Should select next item");
+  is(removeBtn.disabled, true, "Should disable the removeSelected button");
 
   let saveBtn = frameDoc.getElementById("save");
   assertSitesListed(doc, fakeHosts.slice(2));
   saveBtn.doCommand();
 
   await removeDialogOpenPromise;
   await settingsDialogClosePromise;
   await openSiteDataSettingsDialog();
--- a/browser/components/preferences/in-content/tests/siteData/head.js
+++ b/browser/components/preferences/in-content/tests/siteData/head.js
@@ -135,16 +135,17 @@ function assertSitesListed(doc, hosts) {
   let removeAllBtn = frameDoc.getElementById("removeAll");
   let sitesList = frameDoc.getElementById("sitesList");
   let totalSitesNumber = sitesList.getElementsByTagName("richlistitem").length;
   is(totalSitesNumber, hosts.length, "Should list the right sites number");
   hosts.forEach(host => {
     let site = sitesList.querySelector(`richlistitem[host="${host}"]`);
     ok(site, `Should list the site of ${host}`);
   });
+  is(removeBtn.disabled, true, "Should disable the removeSelected button");
   is(removeAllBtn.disabled, false, "Should enable the removeAllBtn button");
 }
 
 const mockSiteDataManager = {
 
   _SiteDataManager: null,
   _originalQMS: null,
   _originalRemoveQuotaUsage: null,
--- a/browser/components/preferences/siteDataSettings.js
+++ b/browser/components/preferences/siteDataSettings.js
@@ -254,29 +254,18 @@ let gSiteDataSettings = {
   },
 
   onCommandSearch() {
     this._buildSitesList(this._sites);
     this._list.clearSelection();
   },
 
   onClickRemoveSelected() {
-    let lastIndex = this._list.selectedItems.length - 1;
-    let lastSelectedItem = this._list.selectedItems[lastIndex];
-    let lastSelectedItemPosition = this._list.getIndexOfItem(lastSelectedItem);
-    let nextSelectedItem = this._list.getItemAtIndex(lastSelectedItemPosition + 1);
-
     this._removeSiteItems(this._list.selectedItems);
     this._list.clearSelection();
-
-    if (nextSelectedItem) {
-      this._list.selectedItem = nextSelectedItem;
-    } else {
-      this._list.selectedIndex = this._list.itemCount - 1;
-    }
   },
 
   onClickRemoveAll() {
     let siteItems = this._list.getElementsByTagName("richlistitem");
     if (siteItems.length > 0) {
       this._removeSiteItems(siteItems);
     }
   },