зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4042a500db
Коммит
e03985c57d
|
@ -76,24 +76,28 @@ function recreateTree(element) {
|
|||
* *labels* are being shown correctly as items in the popup.
|
||||
*/
|
||||
function checkAutoCompleteResults(actualValues, expectedValues, hostname, msg) {
|
||||
if (hostname !== null) {
|
||||
isnot(
|
||||
actualValues.length,
|
||||
0,
|
||||
"There should be items in the autocomplete popup: " +
|
||||
JSON.stringify(actualValues)
|
||||
);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
is(
|
||||
typeof hostname,
|
||||
"string",
|
||||
"checkAutoCompleteResults: hostname must be a string"
|
||||
);
|
||||
|
||||
isnot(
|
||||
actualValues.length,
|
||||
0,
|
||||
"There should be items in the autocomplete popup: " +
|
||||
JSON.stringify(actualValues)
|
||||
);
|
||||
|
||||
// Check the footer first.
|
||||
let footerResult = actualValues[actualValues.length - 1];
|
||||
is(footerResult, "View Saved Logins", "the footer text is shown correctly");
|
||||
|
||||
if (actualValues.length == 1) {
|
||||
is(
|
||||
expectedValues.length,
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче