Bug 1557233 - Port bug 1553237: addEngineWithDetails() now takes parameters in an object and is async. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 21 Jun 2019 09:47:27 +0200
changeset 35910 a0c3fe6d7d95da44975c72cdad17062dc0eea952
parent 35909 fb22bd6b99a785a013208aab99317a25f94f55fd
child 35911 61d97e89fc63ed49039409d54da53f9deec9fb5e
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1557233, 1553237
Bug 1557233 - Port bug 1553237: addEngineWithDetails() now takes parameters in an object and is async. r=jorgk
mail/test/mozmill/newmailaccount/test-newmailaccount.js
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -60,18 +60,22 @@ function setupModule(module) {
   }
 
   // Make sure we enable the Account Provisioner.
   Services.prefs.setBoolPref(kProvisionerEnabledPref, true);
   // Restrict the user's language to just en-US
   Services.locale.requestedLocales = ["en-US"];
 
   // Add a "bar" search engine that we can switch to be the default.
-  Services.search.addEngineWithDetails("bar", null, null, null, "post",
-                                       "http://www.example.com/search");
+  let engineAdded = false;
+  Services.search.addEngineWithDetails("bar", {
+    method: "post",
+    template: "http://www.example.com/search?q={searchTerms}",
+  }).then(() => engineAdded = true);
+  mc.waitFor(() => engineAdded);
 }
 
 function teardownModule(module) {
   // Put the mail.provider.enabled pref back the way it was.
   Services.prefs.setBoolPref(kProvisionerEnabledPref, gProvisionerEnabled);
   // And same with the user languages
   Services.locale.requestedLocales = gOldAcceptLangs;
 }