Bug 1550122 - Fix browser_loginItemErrors.js

Differential Revision: https://phabricator.services.mozilla.com/D44107

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2019-08-30 05:23:18 +00:00
Родитель 055e90fdd2
Коммит 8e29ea4464
1 изменённых файлов: 16 добавлений и 8 удалений

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

@ -15,8 +15,8 @@ add_task(async function setup() {
add_task(async function test_showLoginItemErrors() {
const browser = gBrowser.selectedBrowser;
let LOGIN_TO_UPDATE = new nsLoginInfo(
"https://example.com/",
"https://example.com/",
"https://example.com",
"https://example.com",
null,
"user2",
"pass2"
@ -41,7 +41,7 @@ add_task(async function test_showLoginItemErrors() {
createButton.click();
const loginUpdates = {
origin: "https://example.com/",
origin: "https://example.com",
password: "my1GoodPassword",
username: "user1",
};
@ -55,7 +55,7 @@ add_task(async function test_showLoginItemErrors() {
);
content.dispatchEvent(
// adds first lgoin
// adds first login
new content.CustomEvent("AboutLoginsCreateLogin", event)
);
@ -104,12 +104,20 @@ add_task(async function test_showLoginItemErrors() {
const editButton = loginItem.shadowRoot.querySelector(".edit-button");
editButton.click();
content.dispatchEvent(
// attempt to update LOGIN_TO_UPDATE to a username/origin combination that already exists.
new content.CustomEvent("AboutLoginsUpdateLogin", event)
const updateEvent = Cu.cloneInto(
{
bubbles: true,
detail: Object.assign({guid: loginToUpdate.guid}, loginUpdates),
},
content
);
const loginAlreadyExistsErrorShownAfterUpdate = ContentTaskUtils.waitForCondition(
content.dispatchEvent(
// attempt to update LOGIN_TO_UPDATE to a username/origin combination that already exists.
new content.CustomEvent("AboutLoginsUpdateLogin", updateEvent)
);
const loginAlreadyExistsErrorShownAfterUpdate = await ContentTaskUtils.waitForCondition(
() => {
return !loginItemErrorMessage.hidden;
},