Bug 1619498 - Add missing await in passwordmgr mochitests. r=sfoster

Also simplify checkAutoCompleteResults.

Depends on D66887

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2020-03-17 22:54:50 +00:00
Родитель 4042a500db
Коммит e03985c57d
4 изменённых файлов: 20 добавлений и 16 удалений

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

@ -76,7 +76,17 @@ function recreateTree(element) {
* *labels* are being shown correctly as items in the popup.
*/
function checkAutoCompleteResults(actualValues, expectedValues, hostname, msg) {
if (hostname !== null) {
if (hostname === null) {
checkArrayValues(actualValues, expectedValues, msg);
return;
}
is(
typeof hostname,
"string",
"checkAutoCompleteResults: hostname must be a string"
);
isnot(
actualValues.length,
0,
@ -87,12 +97,6 @@ function checkAutoCompleteResults(actualValues, expectedValues, hostname, msg) {
// Check the footer first.
let footerResult = actualValues[actualValues.length - 1];
is(footerResult, "View Saved Logins", "the footer text is shown correctly");
}
if (hostname === null) {
checkArrayValues(actualValues, expectedValues, msg);
return;
}
if (actualValues.length == 1) {
is(

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

@ -83,7 +83,7 @@ async function setup(formUrl) {
await promiseFormsProcessed();
hostname = SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
hostname = await SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
return this.content.document.documentURIObject.host;
});
}

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

@ -81,7 +81,7 @@ async function setup(formUrl = HTTPS_FORM_URL) {
await promiseFormsProcessed();
hostname = SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
hostname = await SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
return this.content.document.documentURIObject.host;
});
}

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

@ -60,7 +60,7 @@ add_task(async function setup() {
await promiseFormsProcessed();
hostname = SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
hostname = await SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
return this.content.document.documentURIObject.host;
});