From c328cc347375a85603dba4b6444e9940b9260fe4 Mon Sep 17 00:00:00 2001 From: Timothy Guan-tin Chien Date: Fri, 18 Nov 2016 16:33:13 +0800 Subject: [PATCH] Bug 1318194 - Always lists matching logins regardless of page security, r=MattN The logic here needs update; the insecure autofill pref should only affact the actual autofill. We should always represent the list of saved login on the dropdown regardless of the pref and the page security. MozReview-Commit-ID: 6stMPQjBO14 --HG-- extra : rebase_source : cb38ed6a88f1307f3278597030e8d75cc0e92cba --- toolkit/components/passwordmgr/LoginManagerContent.jsm | 9 +++------ .../test/mochitest/test_password_field_autocomplete.html | 7 ++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index c3bc60bd0705..917ab11e3a8c 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -1294,13 +1294,10 @@ UserAutoCompleteResult.prototype = { return duplicates; } - let currentMatchingLogins = (!LoginHelper.insecureAutofill && !this._isSecure) ? - [] : this._matchingLogins; - this._showInsecureFieldWarning = (!this._isSecure && LoginHelper.showInsecureFieldWarning) ? 1 : 0; - this.logins = currentMatchingLogins.sort(loginSort); - this.matchCount = currentMatchingLogins.length + this._showInsecureFieldWarning; - this._duplicateUsernames = findDuplicates(currentMatchingLogins); + this.logins = this._matchingLogins.sort(loginSort); + this.matchCount = this._matchingLogins.length + this._showInsecureFieldWarning; + this._duplicateUsernames = findDuplicates(this._matchingLogins); if (this.matchCount > 0) { this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS; diff --git a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html index 6cd88fba6215..7472cc256cbb 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html @@ -228,7 +228,12 @@ add_task(function* test_form1_enabledInsecureFieldWarning_disabledInsecureAutoFi let popupState = yield getPopupState(); is(popupState.selectedIndex, -1, "Check no entries are selected upon opening"); - let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised."]; + let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised.", + "No username (" + DATE_NOW_STRING + ")", + "tempuser1", + "testuser2", + "testuser3", + "zzzuser4"]; checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly."); doKey("down"); // select insecure warning