Commit 62025568 authored by Dorel Luca's avatar Dorel Luca
Browse files

Backed out 2 changesets (bug 1530029) for Mochitest failues in...

Backed out 2 changesets (bug 1530029) for Mochitest failues in toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html

Backed out changeset ad613d1154eb (bug 1530029)
Backed out changeset 21d6040d2bd8 (bug 1530029)
parent cdedc6cb
......@@ -1703,7 +1703,6 @@ pref("extensions.pocket.site", "getpocket.com");
pref("signon.schemeUpgrades", true);
pref("signon.privateBrowsingCapture.enabled", true);
pref("signon.showAutoCompleteFooter", true);
// Enable the "Simplify Page" feature in Print Preview. This feature
// is disabled by default in toolkit.
......
......@@ -536,7 +536,6 @@ const listeners = {
"PasswordManager:autoCompleteLogins": ["LoginManagerParent"],
"PasswordManager:removeLogin": ["LoginManagerParent"],
"PasswordManager:insecureLoginFormPresent": ["LoginManagerParent"],
"PasswordManager:OpenPreferences": ["LoginManagerParent"],
// PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js
"rtcpeer:CancelRequest": ["webrtcUI"],
"rtcpeer:Request": ["webrtcUI"],
......
......@@ -31,7 +31,6 @@ var LoginHelper = {
schemeUpgrades: null,
insecureAutofill: null,
privateBrowsingCaptureEnabled: null,
showAutoCompleteFooter: null,
init() {
// Watch for pref changes to update cached pref values.
......@@ -49,8 +48,8 @@ var LoginHelper = {
Services.prefs.getBoolPref("signon.privateBrowsingCapture.enabled");
this.schemeUpgrades = Services.prefs.getBoolPref("signon.schemeUpgrades");
this.showAutoCompleteFooter = Services.prefs.getBoolPref("signon.showAutoCompleteFooter");
this.storeWhenAutocompleteOff = Services.prefs.getBoolPref("signon.storeWhenAutocompleteOff");
this.showAutoCompleteFooter = Services.prefs.getBoolPref("signon.showAutoCompleteFooter");
},
createLogger(aLogPrefix) {
......
......@@ -192,9 +192,6 @@ var LoginManagerContent = {
// Number of outstanding requests to each manager.
_managers: new Map(),
// Input element on which enter keydown event was fired.
_keyDownEnterForInput: null,
_takeRequest(msg) {
let data = msg.data;
let request = this._requests.get(data.requestId);
......@@ -239,27 +236,6 @@ var LoginManagerContent = {
return deferred.promise;
},
_onKeyDown(event) {
let focusedElement = LoginManagerContent._formFillService.focusedInput;
if (event.keyCode != event.DOM_VK_RETURN || focusedElement != event.target) {
this._keyDownEnterForInput = null;
return;
}
LoginManagerContent._keyDownEnterForInput = focusedElement;
},
_onPopupClosed(selectedRowStyle, mm) {
let focusedElement = LoginManagerContent._formFillService.focusedInput;
let eventTarget = LoginManagerContent._keyDownEnterForInput;
if (!eventTarget || eventTarget !== focusedElement ||
selectedRowStyle != "loginsFooter") {
this._keyDownEnterForInput = null;
return;
}
let hostname = eventTarget.ownerDocument.documentURIObject.host;
mm.sendAsyncMessage("PasswordManager:OpenPreferences", {hostname});
},
receiveMessage(msg, topWindow) {
if (msg.name == "PasswordManager:fillForm") {
this.fillForm({
......@@ -272,10 +248,10 @@ var LoginManagerContent = {
return;
}
let request = this._takeRequest(msg);
switch (msg.name) {
case "PasswordManager:loginsFound": {
let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins);
let request = this._takeRequest(msg);
request.promise.resolve({
form: request.form,
loginsFound,
......@@ -287,25 +263,9 @@ var LoginManagerContent = {
case "PasswordManager:loginsAutoCompleted": {
let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins);
let messageManager = msg.target;
let request = this._takeRequest(msg);
request.promise.resolve({ logins: loginsFound, messageManager });
break;
}
case "FormAutoComplete:PopupOpened": {
let {chromeEventHandler} = msg.target.docShell;
chromeEventHandler.addEventListener("keydown", this._onKeyDown,
true);
break;
}
case "FormAutoComplete:PopupClosed": {
this._onPopupClosed(msg.data.selectedRowStyle, msg.target);
let {chromeEventHandler} = msg.target.docShell;
chromeEventHandler.removeEventListener("keydown", this._onKeyDown,
true);
break;
}
}
},
......@@ -365,11 +325,6 @@ var LoginManagerContent = {
isPasswordField: aElement.type == "password",
};
if (LoginHelper.showAutoCompleteFooter) {
messageManager.addMessageListener("FormAutoComplete:PopupOpened", this);
messageManager.addMessageListener("FormAutoComplete:PopupClosed", this);
}
return this._sendRequest(messageManager, requestData,
"PasswordManager:autoCompleteLogins",
messageData);
......
......@@ -115,11 +115,6 @@ var LoginManagerParent = {
AutoCompletePopup.removeLogin(login);
break;
}
case "PasswordManager:OpenPreferences": {
LoginHelper.openPasswordManager(msg.target.ownerGlobal, msg.data.hostname);
break;
}
}
return undefined;
......
......@@ -21,24 +21,6 @@ function loginList() {
];
}
function openPopup(popup, browser) {
return new Promise(async (resolve) => {
let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown");
await SimpleTest.promiseFocus(browser);
info("content window focused");
// Focus the username field to open the popup.
await ContentTask.spawn(browser, null, function openAutocomplete() {
content.document.getElementById("form-basic-username").focus();
});
let shown = await promiseShown;
ok(shown, "autocomplete popup shown");
resolve(shown);
});
}
/**
* Initialize logins and set prefs needed for the test.
*/
......@@ -53,50 +35,27 @@ add_task(async function test_initialize() {
}
});
add_task(async function test_autocomplete_footer_onclick() {
add_task(async function test_autocomplete_footer() {
let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH;
await BrowserTestUtils.withNewTab({
gBrowser,
url,
}, async function footer_onclick(browser) {
}, async function(browser) {
let popup = document.getElementById("PopupAutoComplete");
ok(popup, "Got popup");
await openPopup(popup, browser);
let footer = popup.querySelector(`[originaltype="loginsFooter"]`);
ok(footer, "Got footer richlistitem");
await TestUtils.waitForCondition(() => {
return !EventUtils.isHidden(footer);
}, "Waiting for footer to become visible");
EventUtils.synthesizeMouseAtCenter(footer, {});
await TestUtils.waitForCondition(() => {
return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null;
}, "Waiting for the password manager dialog to open");
info("Login dialog was opened");
let window = Services.wm.getMostRecentWindow("Toolkit:PasswordManager");
await TestUtils.waitForCondition(() => {
return window.document.getElementById("filter").value == "example.com";
}, "Waiting for the search string to filter logins");
let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown");
window.close();
popup.hidePopup();
});
});
await SimpleTest.promiseFocus(browser);
info("content window focused");
add_task(async function test_autocomplete_footer_keydown() {
let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH;
await BrowserTestUtils.withNewTab({
gBrowser,
url,
}, async function footer_enter_keydown(browser) {
let popup = document.getElementById("PopupAutoComplete");
ok(popup, "Got popup");
// Focus the username field to open the popup.
await ContentTask.spawn(browser, null, function openAutocomplete() {
content.document.getElementById("form-basic-username").focus();
});
await openPopup(popup, browser);
await promiseShown;
ok(promiseShown, "autocomplete shown");
let footer = popup.querySelector(`[originaltype="loginsFooter"]`);
ok(footer, "Got footer richlistitem");
......@@ -105,11 +64,7 @@ add_task(async function test_autocomplete_footer_keydown() {
return !EventUtils.isHidden(footer);
}, "Waiting for footer to become visible");
await EventUtils.synthesizeKey("KEY_ArrowDown");
await EventUtils.synthesizeKey("KEY_ArrowDown");
await EventUtils.synthesizeKey("KEY_ArrowDown");
await EventUtils.synthesizeKey("KEY_Enter");
EventUtils.synthesizeMouseAtCenter(footer, {});
await TestUtils.waitForCondition(() => {
return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null;
}, "Waiting for the password manager dialog to open");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment