Bug 1217152 - disable insecure password warning and enable autofill on HTTP pages for password manager tests using pwmgr_common.js. r=MattN a=jcristau
authorTanvi Vyas <tanvi@mozilla.com>
Wed, 04 Jan 2017 12:44:21 -0500
changeset 353335 a51cdeb88cbfee1e51234a575ccb8aa75130a07d
parent 353334 872f6e1948f5217fd9ee9f650fbaa3a259deab9d
child 353336 16c3bb37545f1e3d2ac1cb5935f8cff69255c18b
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN, jcristau
bugs1217152
milestone52.0a2
Bug 1217152 - disable insecure password warning and enable autofill on HTTP pages for password manager tests using pwmgr_common.js. r=MattN a=jcristau MozReview-Commit-ID: JfjTNOcKwLQ
toolkit/components/passwordmgr/test/pwmgr_common.js
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/pwmgr_common.js
@@ -427,17 +427,22 @@ if (this.addMessageListener) {
   });
 
   var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
   globalMM.addMessageListener("RemoteLogins:onFormSubmit", function onFormSubmit(message) {
     sendAsyncMessage("formSubmissionProcessed", message.data, message.objects);
   });
 } else {
   // Code to only run in the mochitest pages (not in the chrome script).
+  SpecialPowers.pushPrefEnv({"set": [["signon.autofillForms.http", true],
+                                     ["security.insecure_field_warning.contextual.enabled", false]]
+                            });
+
   SimpleTest.registerCleanupFunction(() => {
+    SpecialPowers.popPrefEnv();
     runInParent(function cleanupParent() {
       const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
       Cu.import("resource://gre/modules/Services.jsm");
       Cu.import("resource://gre/modules/LoginManagerParent.jsm");
 
       // Remove all logins and disabled hosts
       Services.logins.removeAllLogins();