Bug 1619498 - Fix passwordmgr mochitest-plain test-verify failures. r=sfoster

Also add some logging that seems generally useful.

Depends on D67087

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2020-03-17 22:58:40 +00:00
Родитель e03985c57d
Коммит 35dc6f306b
6 изменённых файлов: 12 добавлений и 9 удалений

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

@ -1202,11 +1202,13 @@ this.LoginManagerChild = class LoginManagerChild extends JSWindowActorChild {
form
);
if (fieldOverrideRecipe) {
log("Has fieldOverrideRecipe", fieldOverrideRecipe);
let pwOverrideField = LoginRecipesContent.queryLoginField(
form,
fieldOverrideRecipe.passwordSelector
);
if (pwOverrideField) {
log("Has pwOverrideField", pwOverrideField);
// The field from the password override may be in a different LoginForm.
let formLike = LoginFormFactory.createFromField(pwOverrideField);
pwFields = [

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

@ -219,6 +219,7 @@ this.LoginRecipesContent = {
_recipeCache: new WeakMap(),
_clearRecipeCache() {
log.debug("_clearRecipeCache");
this._recipeCache = new WeakMap();
},
@ -309,7 +310,7 @@ this.LoginRecipesContent = {
*/
getFieldOverrides(aRecipes, aForm) {
let recipes = this._filterRecipesForForm(aRecipes, aForm);
log.debug("getFieldOverrides: filtered recipes:", recipes);
log.debug("getFieldOverrides: filtered recipes:", recipes.size, recipes);
if (!recipes.size) {
return null;
}

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

@ -43,7 +43,7 @@ scheme = https
skip-if = toolkit == 'android' # autocomplete
[test_autocomplete_password_open.html]
scheme = https
skip-if = toolkit == 'android' # autocomplete
skip-if = toolkit == 'android' || verify # autocomplete
[test_autocomplete_sandboxed.html]
scheme = https
skip-if = toolkit == 'android' # autocomplete
@ -128,7 +128,7 @@ scheme = https
skip-if = toolkit == 'android' # password generation
[test_master_password.html]
scheme = https
skip-if = os != 'mac' # Tests desktop prompts and bug 1333264
skip-if = os != 'mac' || verify # Tests desktop prompts and bug 1333264
support-files =
chrome_timeout.js
subtst_master_pass.html

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

@ -543,7 +543,7 @@ const PWMGR_COMMON_PARENT = runInParent(
);
SimpleTest.registerCleanupFunction(() => {
SpecialPowers.popPrefEnv();
SpecialPowers.flushPrefEnv();
PWMGR_COMMON_PARENT.sendAsyncMessage("cleanup");

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

@ -31,15 +31,17 @@ let chromeScript = runChecksAfterCommonInit();
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Login Manager: contextual inscure password warning without saved logins. **/
/** Test for Login Manager: contextual insecure password warning without saved logins. **/
// Set to pref before the document loads.
let originalInsecureEnabled = SpecialPowers.getBoolPref(
"security.insecure_field_warning.contextual.enabled");
SpecialPowers.setBoolPref(
"security.insecure_field_warning.contextual.enabled", true);
SimpleTest.registerCleanupFunction(() => {
SpecialPowers.clearUserPref(
"security.insecure_field_warning.contextual.enabled");
SpecialPowers.setBoolPref(
"security.insecure_field_warning.contextual.enabled", originalInsecureEnabled);
});
let uname = $_(1, "uname");

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

@ -23,8 +23,6 @@
// These are magically defined on the window due to the iframe IDs
/* global iframe1, iframe2a, iframe2b */
let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
/**
* Add a listener to add some logins to be autofilled in the HTTP/proxy auth. prompts later.
*/