author | Cosmin Sabou <csabou@mozilla.com> |
Thu, 19 May 2022 10:40:35 +0300 | |
changeset 618209 | 3c058a1405e429eda049fb2b9817fd079b29ec79 |
parent 618208 | 3666e4a93f79f15d1241d870b2cb626d36c72dda |
child 618210 | d75fac0be37526a568c1601ddbcc7839dfa94bcb |
push id | 39719 |
push user | smolnar@mozilla.com |
push date | Thu, 19 May 2022 16:03:14 +0000 |
treeherder | mozilla-central@cc776278c4ea [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1722228 |
milestone | 102.0a1 |
backs out | 9fe7e79e2e01283e1de3b4df674ec6b5578d8e0e |
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
|
--- a/browser/components/preferences/dialogs/siteDataSettings.js +++ b/browser/components/preferences/dialogs/siteDataSettings.js @@ -318,21 +318,16 @@ let gSiteDataSettings = { }, onKeyPress(e) { if ( e.keyCode == KeyEvent.DOM_VK_DELETE || (AppConstants.platform == "macosx" && e.keyCode == KeyEvent.DOM_VK_BACK_SPACE) ) { - if (!e.target.closest("#sitesList")) { - // The user is typing or has not selected an item from the list to remove - return; - } - // The users intention is to delete site data this.removeSelected(); } }, onSelect() { this._updateButtonsState(); }, };
--- a/browser/components/preferences/tests/siteData/browser_siteData2.js +++ b/browser/components/preferences/tests/siteData/browser_siteData2.js @@ -357,111 +357,8 @@ add_task(async function() { await settingsDialogClosePromise; await updatePromise; await openSiteDataSettingsDialog(); assertAllSitesNotListed(win); await SiteDataTestUtils.clear(); BrowserTestUtils.removeTab(gBrowser.selectedTab); }); - -// Tests clearing search box content via backspace does not delete site data -add_task(async function() { - let hosts = await addTestData([ - { - usage: 1024, - origin: "https://account.xyz.com", - persisted: true, - }, - { - usage: 1024, - origin: "https://shopping.xyz.com", - persisted: false, - }, - { - usage: 1024, - origin: "http://cinema.bar.com", - persisted: true, - }, - { - usage: 1024, - origin: "http://email.bar.com", - persisted: false, - }, - ]); - - await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true }); - await openSiteDataSettingsDialog(); - - let win = gBrowser.selectedBrowser.contentWindow; - let doc = gBrowser.selectedBrowser.contentDocument; - let frameDoc = win.gSubDialog._topDialog._frame.contentDocument; - let searchBox = frameDoc.getElementById("searchBox"); - searchBox.value = "xyz"; - searchBox.doCommand(); - assertSitesListed( - doc, - hosts.filter(host => host.includes("xyz")) - ); - - // Make sure the focus is on the search box - searchBox.focus(); - EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win); - assertSitesListed( - doc, - hosts.filter(host => host.includes("xyz")) - ); - - await SiteDataTestUtils.clear(); - BrowserTestUtils.removeTab(gBrowser.selectedTab); -}); - -// Tests remove site data via backspace -add_task(async function() { - let hosts = await addTestData([ - { - usage: 1024, - origin: "https://account.xyz.com", - persisted: true, - }, - { - usage: 1024, - origin: "https://shopping.xyz.com", - persisted: false, - }, - { - usage: 1024, - origin: "http://cinema.bar.com", - persisted: true, - }, - { - usage: 1024, - origin: "http://email.bar.com", - persisted: false, - }, - ]); - - await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true }); - await openSiteDataSettingsDialog(); - - let win = gBrowser.selectedBrowser.contentWindow; - let doc = gBrowser.selectedBrowser.contentDocument; - let frameDoc = win.gSubDialog._topDialog._frame.contentDocument; - // Test initial state - assertSitesListed(doc, hosts); - - let sitesList = frameDoc.getElementById("sitesList"); - let site = sitesList.querySelector(`richlistitem[host="xyz.com"]`); - if (site) { - // Move the focus from the search box to the list and select an item - sitesList.focus(); - site.click(); - EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win); - } - - assertSitesListed( - doc, - hosts.filter(host => !host.includes("xyz")) - ); - - await SiteDataTestUtils.clear(); - BrowserTestUtils.removeTab(gBrowser.selectedTab); -});
--- a/browser/components/preferences/tests/siteData/browser_siteData_multi_select.js +++ b/browser/components/preferences/tests/siteData/browser_siteData_multi_select.js @@ -91,18 +91,16 @@ add_task(async function() { // Select some other sites to remove with Delete. hosts.slice(2, 4).forEach(host => { let site = sitesList.querySelector(`richlistitem[host="${host}"]`); sitesList.addItemToSelection(site); }); is(removeBtn.disabled, false, "Should enable the removeSelected button"); - // Move the focus from the search box to the list - sitesList.focus(); EventUtils.synthesizeKey("VK_DELETE"); is(sitesList.selectedIndex, 0, "Should select next item"); assertSitesListed(doc, hosts.slice(4)); updatePromise = promiseSiteDataManagerSitesUpdated(); let saveBtn = frameDoc.querySelector("dialog").getButton("accept"); saveBtn.doCommand();