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
This commit is contained in:
Timothy Guan-tin Chien 2016-11-18 16:33:13 +08:00
Родитель 045b5c8a3c
Коммит c328cc3473
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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