From be6b66c0fefcad62d49a15f62905f2c5d14b712b Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Fri, 25 Jan 2019 20:35:26 +0000 Subject: [PATCH] Bug 1518094 - Fix test_*_autocomplete.html autofill failures by setting prefs sooner. r=jaws Move prefs from pwmgr_common.js to mochitest.ini and remove redundant calls to set those same prefs. Differential Revision: https://phabricator.services.mozilla.com/D17589 --HG-- extra : moz-landing-system : lando --- toolkit/components/passwordmgr/test/mochitest.ini | 5 +++++ toolkit/components/passwordmgr/test/mochitest/mochitest.ini | 6 ++++++ .../test/mochitest/test_basic_form_autocomplete.html | 2 -- .../mochitest/test_insecure_form_field_autocomplete.html | 3 +-- .../passwordmgr/test/mochitest/test_username_focus.html | 4 ---- toolkit/components/passwordmgr/test/pwmgr_common.js | 5 ----- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/toolkit/components/passwordmgr/test/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest.ini index 364425b706be..a9c1a0bf2a85 100644 --- a/toolkit/components/passwordmgr/test/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest.ini @@ -1,4 +1,9 @@ [DEFAULT] +prefs = + signon.rememberSignons=true + signon.autofillForms.http=true + security.insecure_field_warning.contextual.enabled=false + network.auth.non-web-content-triggered-resources-http-auth-allow=true skip-if = e10s support-files = authenticate.sjs diff --git a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini index 88f8740eae15..f86a1c9db604 100644 --- a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini @@ -1,4 +1,10 @@ [DEFAULT] +prefs = + signon.rememberSignons=true + signon.autofillForms.http=true + security.insecure_field_warning.contextual.enabled=false + network.auth.non-web-content-triggered-resources-http-auth-allow=true + support-files = ../../../prompts/test/chromeScript.js ../../../prompts/test/prompt_common.js diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html index 9dc6a8260c75..1287ea04db71 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html @@ -209,8 +209,6 @@ function spinEventLoop() { } add_task(async function setup() { - await SpecialPowers.pushPrefEnv({"set": [["security.insecure_field_warning.contextual.enabled", false], - ["signon.autofillForms.http", true]]}); listenForUnexpectedPopupShown(); }); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html index 2bb9ba8e4917..46b4ad5b0617 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html @@ -209,8 +209,7 @@ function spinEventLoop() { } add_task(async function setup() { - await SpecialPowers.pushPrefEnv({"set": [["security.insecure_field_warning.contextual.enabled", true], - ["signon.autofillForms.http", true]]}); + await SpecialPowers.pushPrefEnv({"set": [["security.insecure_field_warning.contextual.enabled", true]]}); listenForUnexpectedPopupShown(); }); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html b/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html index ba2609ee77a1..0761656590c7 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html @@ -114,10 +114,6 @@ function removeFocus() { } add_task(async function setup() { - await SpecialPowers.pushPrefEnv({"set": [ - ["security.insecure_field_warning.contextual.enabled", false], - ]}); - ok(readyPromise, "check promise is available"); await readyPromise; }); diff --git a/toolkit/components/passwordmgr/test/pwmgr_common.js b/toolkit/components/passwordmgr/test/pwmgr_common.js index 190940c8b524..6374f5d07c13 100644 --- a/toolkit/components/passwordmgr/test/pwmgr_common.js +++ b/toolkit/components/passwordmgr/test/pwmgr_common.js @@ -447,11 +447,6 @@ if (this.addMessageListener) { }); } else { // Code to only run in the mochitest pages (not in the chrome script). - SpecialPowers.pushPrefEnv({"set": [["signon.rememberSignons", true], - ["signon.autofillForms.http", true], - ["security.insecure_field_warning.contextual.enabled", false], - ["network.auth.non-web-content-triggered-resources-http-auth-allow", true]], - }); SimpleTest.registerCleanupFunction(() => { SpecialPowers.popPrefEnv(); runInParent(function cleanupParent() {