From 1fa2c4a121400eb77ded785dae56b44757ce7d13 Mon Sep 17 00:00:00 2001 From: Razvan Maries Date: Sat, 4 Jul 2020 12:54:15 +0300 Subject: [PATCH] Backed out changeset 10c9e57fb4f8 (bug 1641777) for perma failures on browser_openImportCSV.js. --- .../static/browser_all_files_referenced.js | 2 + browser/components/BrowserGlue.jsm | 3 +- .../aboutlogins/AboutLoginsChild.jsm | 18 +- .../aboutlogins/AboutLoginsParent.jsm | 42 +- .../aboutlogins/content/aboutLogins.html | 10 +- .../content/components/login-intro.js | 8 +- .../content/components/menu-button.css | 6 +- .../aboutlogins/tests/browser/browser.ini | 1 - .../tests/browser/browser_noLoginsView.js | 2 +- .../tests/browser/browser_openImport.js | 2 +- .../tests/browser/browser_openImportCSV.js | 100 ---- .../tests/chrome/test_menu_button.html | 4 +- browser/locales/en-US/browser/aboutLogins.ftl | 18 +- third_party/moz.build | 3 - .../components/passwordmgr/LoginCSVImport.jsm | 169 ------- .../components/passwordmgr/LoginExport.jsm | 8 +- .../components/passwordmgr/LoginHelper.jsm | 77 +-- .../passwordmgr/LoginManagerParent.jsm | 6 +- toolkit/components/passwordmgr/moz.build | 1 - .../components/passwordmgr/nsILoginInfo.idl | 3 +- .../passwordmgr/nsILoginManager.idl | 10 +- .../passwordmgr/nsILoginManagerStorage.idl | 13 +- .../passwordmgr/test/LoginTestUtils.jsm | 67 +-- .../test/unit/test_displayOrigin.js | 2 +- .../test/unit/test_maybeImportLogin.js | 91 +--- .../test/unit/test_module_LoginCSVImport.js | 439 ------------------ .../test/unit/test_module_LoginExport.js | 2 +- .../passwordmgr/test/unit/xpcshell.ini | 1 - toolkit/components/telemetry/Events.yaml | 1 - 29 files changed, 75 insertions(+), 1034 deletions(-) delete mode 100644 browser/components/aboutlogins/tests/browser/browser_openImportCSV.js delete mode 100644 toolkit/components/passwordmgr/LoginCSVImport.jsm delete mode 100644 toolkit/components/passwordmgr/test/unit/test_module_LoginCSVImport.js diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js index c70e597e1436..e9da68fb7c6e 100644 --- a/browser/base/content/test/static/browser_all_files_referenced.js +++ b/browser/base/content/test/static/browser_all_files_referenced.js @@ -178,6 +178,8 @@ var whitelist = [ }, // Bug 1356031 (only used by devtools) { file: "chrome://global/skin/icons/error-16.png" }, + // Bug 1641777 (only used by devtools) + { file: "chrome://global/content/third_party/d3/d3.js" }, // Bug 1344267 { file: "chrome://marionette/content/test.xhtml" }, { file: "chrome://marionette/content/test_dialog.properties" }, diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 122286873ed3..0c743969d92f 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -96,8 +96,7 @@ let JSWINDOWACTORS = { AboutLoginsDeleteLogin: { wantUntrusted: true }, AboutLoginsDismissBreachAlert: { wantUntrusted: true }, AboutLoginsHideFooter: { wantUntrusted: true }, - AboutLoginsImportFromBrowser: { wantUntrusted: true }, - AboutLoginsImportFromFile: { wantUntrusted: true }, + AboutLoginsImport: { wantUntrusted: true }, AboutLoginsInit: { wantUntrusted: true }, AboutLoginsGetHelp: { wantUntrusted: true }, AboutLoginsOpenMobileAndroid: { wantUntrusted: true }, diff --git a/browser/components/aboutlogins/AboutLoginsChild.jsm b/browser/components/aboutlogins/AboutLoginsChild.jsm index aefa15a08604..26f80646f3f0 100644 --- a/browser/components/aboutlogins/AboutLoginsChild.jsm +++ b/browser/components/aboutlogins/AboutLoginsChild.jsm @@ -125,10 +125,6 @@ class AboutLoginsChild extends JSWindowActorChild { }); break; } - case "AboutLoginsExportPasswords": { - this.sendAsyncMessage("AboutLogins:ExportPasswords"); - break; - } case "AboutLoginsGetHelp": { this.sendAsyncMessage("AboutLogins:GetHelp"); break; @@ -137,7 +133,7 @@ class AboutLoginsChild extends JSWindowActorChild { this.sendAsyncMessage("AboutLogins:HideFooter"); break; } - case "AboutLoginsImportFromBrowser": { + case "AboutLoginsImport": { this.sendAsyncMessage("AboutLogins:Import"); recordTelemetryEvent({ object: "import_from_browser", @@ -145,14 +141,6 @@ class AboutLoginsChild extends JSWindowActorChild { }); break; } - case "AboutLoginsImportFromFile": { - this.sendAsyncMessage("AboutLogins:ImportPasswords"); - recordTelemetryEvent({ - object: "import_from_csv", - method: "mgmt_menu_item_used", - }); - break; - } case "AboutLoginsOpenMobileAndroid": { this.sendAsyncMessage("AboutLogins:OpenMobileAndroid", { source: event.detail, @@ -215,6 +203,10 @@ class AboutLoginsChild extends JSWindowActorChild { }); break; } + case "AboutLoginsExportPasswords": { + this.sendAsyncMessage("AboutLogins:ExportPasswords"); + break; + } } } diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm index d033c6817c5e..1bc1580010c1 100644 --- a/browser/components/aboutlogins/AboutLoginsParent.jsm +++ b/browser/components/aboutlogins/AboutLoginsParent.jsm @@ -17,7 +17,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { LoginBreaches: "resource:///modules/LoginBreaches.jsm", LoginHelper: "resource://gre/modules/LoginHelper.jsm", LoginExport: "resource://gre/modules/LoginExport.jsm", - LoginCSVImport: "resource://gre/modules/LoginCSVImport.jsm", MigrationUtils: "resource:///modules/MigrationUtils.jsm", OSKeyStore: "resource://gre/modules/OSKeyStore.jsm", Services: "resource://gre/modules/Services.jsm", @@ -517,7 +516,7 @@ class AboutLoginsParent extends JSWindowActorParent { let fp = Cc["@mozilla.org/filepicker;1"].createInstance( Ci.nsIFilePicker ); - function fpCallback(aResult) { + let fpCallback = function fpCallback_done(aResult) { if (aResult != Ci.nsIFilePicker.returnCancel) { LoginExport.exportAsCSV(fp.file.path); Services.telemetry.recordEvent( @@ -526,7 +525,7 @@ class AboutLoginsParent extends JSWindowActorParent { "export_complete" ); } - } + }; let [ title, defaultFilename, @@ -556,43 +555,6 @@ class AboutLoginsParent extends JSWindowActorParent { fp.open(fpCallback); break; } - case "AboutLogins:ImportPasswords": { - let fp = Cc["@mozilla.org/filepicker;1"].createInstance( - Ci.nsIFilePicker - ); - async function fpCallback(aResult) { - if (aResult != Ci.nsIFilePicker.returnCancel) { - await LoginCSVImport.importFromCSV(fp.file.path); - Services.telemetry.recordEvent( - "pwmgr", - "mgmt_menu_item_used", - "import_csv_complete" - ); - } - } - let [ - title, - okButtonLabel, - csvFilterTitle, - ] = await AboutLoginsL10n.formatValues([ - { - id: "about-logins-import-file-picker-title", - }, - { - id: "about-logins-import-file-picker-import-button", - }, - { - id: "about-logins-import-file-picker-csv-filter-title", - }, - ]); - - fp.init(ownerGlobal, title, Ci.nsIFilePicker.modeOpen); - fp.appendFilter(csvFilterTitle, "*.csv"); - fp.appendFilters(Ci.nsIFilePicker.filterAll); - fp.okButtonLabel = okButtonLabel; - fp.open(fpCallback); - break; - } } } diff --git a/browser/components/aboutlogins/content/aboutLogins.html b/browser/components/aboutlogins/content/aboutLogins.html index 716fcc0c6c8e..1363db0653b9 100644 --- a/browser/components/aboutlogins/content/aboutLogins.html +++ b/browser/components/aboutlogins/content/aboutLogins.html @@ -131,7 +131,7 @@ -

+

-
@@ -271,8 +270,7 @@