add_setup(async function test_common_initialize() { // Before initializing the service for the first time, we should copy the key // file required to decrypt the logins contained in the SQLite databases used // by migration tests. This file is not required for the other tests. const keyDBName = "key4.db";
await IOUtils.copy(
do_get_file(`data/${keyDBName}`).path,
PathUtils.join(PathUtils.profileDir, keyDBName)
);
// Ensure that the service and the storage module are initialized.
await Services.logins.initializationPromise;
Services.prefs.setBoolPref(RELATED_REALMS_ENABLED_PREF, true); if (LoginHelper.relatedRealmsEnabled) { // Ensure that there is a mocked Remote Settings database for the // "websites-with-shared-credential-backends" collection
await LoginTestUtils.remoteSettings.setupWebsitesWithSharedCredentials();
}
});
add_setup(async function test_common_prefs() {
Services.prefs.setStringPref(NEW_PASSWORD_HEURISTIC_ENABLED_PREF, "0.75");
});
/** *ComparetwoFormLiketoseeiftheyrepresentthesameinformation.Elements *arecomparedusingtheir@idattribute.
*/ function formLikeEqual(a, b) { Assert.strictEqual(
Object.keys(a).length,
Object.keys(b).length, "Check the formLikes have the same number of properties"
);
for (let propName of Object.keys(a)) { if (propName == "elements") { Assert.strictEqual(
a.elements.length,
b.elements.length, "Check element count"
); for (let i = 0; i < a.elements.length; i++) { Assert.strictEqual(
a.elements[i].id,
b.elements[i].id, "Check element " + i + " id"
);
} continue;
} Assert.strictEqual(
a[propName],
b[propName], "Compare formLike " + propName + " property"
);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.