Bug 1481199 - Drop the obsolete dataType parameter for nsIBrowserSearchService.addEngine. r=mkaply
authorDiego Pino Garcia <dpino@igalia.com>
Mon, 08 Oct 2018 10:12:00 -0500
changeset 495973 eaa627409f750ad32fa96b757a0d35d7601b47c3
parent 495972 f574c731fcb0e65e969a53e86ffd7ff57bbe2000
child 495974 9d7540135cac5a0adc6c9ab34f7f2851ca3b9b1c
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkaply
bugs1481199
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481199 - Drop the obsolete dataType parameter for nsIBrowserSearchService.addEngine. r=mkaply
browser/base/content/browser-pageActions.js
browser/base/content/test/about/browser_aboutHome_search_POST.js
browser/base/content/test/about/head.js
browser/base/content/test/general/browser_keywordSearch_postData.js
browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js
browser/components/search/test/SearchTestUtils.jsm
browser/components/search/test/browser_426329.js
browser/components/search/test/browser_483086.js
browser/components/search/test/browser_addEngine.js
browser/components/search/test/browser_contextmenu.js
browser/components/search/test/browser_healthreport.js
browser/components/search/test/browser_hiddenOneOffs_cleanup.js
browser/components/search/test/head.js
browser/modules/test/browser/browser_ContentSearch.js
browser/modules/test/browser/browser_UsageTelemetry_searchbar.js
browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
mobile/android/chrome/content/browser.js
mobile/android/tests/browser/chrome/test_device_search_engine.html
netwerk/base/nsIBrowserSearchService.idl
toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
toolkit/components/processsingleton/MainProcessSingleton.js
toolkit/components/search/nsSearchService.js
toolkit/components/search/tests/xpcshell/head_search.js
toolkit/components/search/tests/xpcshell/test_addEngineWithExtensionID.js
toolkit/components/search/tests/xpcshell/test_addEngine_callback.js
toolkit/components/search/tests/xpcshell/test_multipleIcons.js
toolkit/components/search/tests/xpcshell/test_notifications.js
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -1170,17 +1170,17 @@ BrowserPageActions.addSearchEngine = {
     // (Because this method isn't called when the panel button is clicked and it
     // shows a subview, and the many-engines case for the urlbar returned early
     // above.)
     let engine = this.engines[0];
     this._installEngine(engine.uri, engine.icon);
   },
 
   _installEngine(uri, image) {
-    Services.search.addEngine(uri, null, image, false, {
+    Services.search.addEngine(uri, image, false, {
       onSuccess: engine => {
         showBrowserPageActionFeedback(this.action);
       },
       onError(errorCode) {
         if (errorCode != Ci.nsISearchInstallCallback.ERROR_DUPLICATE_ENGINE) {
           // Download error is shown by the search service
           return;
         }
--- a/browser/base/content/test/about/browser_aboutHome_search_POST.js
+++ b/browser/base/content/test/about/browser_aboutHome_search_POST.js
@@ -49,12 +49,12 @@ add_task(async function() {
         Services.search.defaultEngine = currEngine;
         try {
           Services.search.removeEngine(engine);
         } catch (ex) {}
         resolve();
       };
       Services.obs.addObserver(searchObserver, "browser-search-engine-modified");
       Services.search.addEngine("http://test:80/browser/browser/base/content/test/about/POSTSearchEngine.xml",
-                                null, null, false);
+                                null, false);
     });
   });
 });
--- a/browser/base/content/test/about/head.js
+++ b/browser/base/content/test/about/head.js
@@ -162,17 +162,17 @@ function promiseContentSearchChange(brow
 
 /**
  * Wait for the search engine to be added.
  */
 function promiseNewEngine(basename) {
   info("Waiting for engine to be added: " + basename);
   return new Promise((resolve, reject) => {
     let url = getRootDirectory(gTestPath) + basename;
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess(engine) {
         info("Search engine added: " + basename);
         registerCleanupFunction(() => {
           try {
             Services.search.removeEngine(engine);
           } catch (ex) { /* Can't remove the engine more than once */ }
         });
         resolve(engine);
--- a/browser/base/content/test/general/browser_keywordSearch_postData.js
+++ b/browser/base/content/test/general/browser_keywordSearch_postData.js
@@ -17,17 +17,17 @@ var gTests = [
 ];
 
 add_task(async function setup() {
   let engineAddedPromise = TestUtils.topicObserved("browser-search-engine-modified", (subject, data) => {
     return data == "engine-added";
   });
 
   Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
-                            null, null, false);
+                            null, false);
 
   let [subject, data] = await engineAddedPromise;
 
   let engine = subject.QueryInterface(Ci.nsISearchEngine);
   info("Observer: " + data + " for " + engine.name);
 
   if (engine.name != "POST Search") {
     Assert.ok(false, "Wrong search engine added");
--- a/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js
+++ b/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js
@@ -37,17 +37,17 @@ async function addBookmark(bookmark) {
     await PlacesUtils.bookmarks.eraseEverything();
   });
 }
 
 function addSearchEngine(basename) {
   return new Promise((resolve, reject) => {
     info("Waiting for engine to be added: " + basename);
     let url = getRootDirectory(gTestPath) + basename;
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess: (engine) => {
         info(`Search engine added: ${basename}`);
         registerCleanupFunction(() => Services.search.removeEngine(engine));
         resolve(engine);
       },
       onError: (errCode) => {
         ok(false, `addEngine failed with error code ${errCode}`);
         reject();
--- a/browser/components/search/test/SearchTestUtils.jsm
+++ b/browser/components/search/test/SearchTestUtils.jsm
@@ -23,17 +23,17 @@ var SearchTestUtils = Object.freeze({
    * @param {String}   url                     The URL of the engine to add.
    * @param {Function} registerCleanupFunction Pass the registerCleanupFunction
    *                                           from the test's scope.
    * @returns {Promise} Returns a promise that is resolved with the new engine
    *                    or rejected if it fails.
    */
   promiseNewSearchEngine(url) {
     return new Promise((resolve, reject) => {
-      Services.search.addEngine(url, null, "", false, {
+      Services.search.addEngine(url, "", false, {
         onSuccess(engine) {
           gTestGlobals.registerCleanupFunction(() => Services.search.removeEngine(engine));
           resolve(engine);
         },
         onError(errCode) {
           gTestGlobals.Assert.ok(false, `addEngine failed with error code ${errCode}`);
           reject();
         },
--- a/browser/components/search/test/browser_426329.js
+++ b/browser/components/search/test/browser_426329.js
@@ -77,17 +77,17 @@ function promiseSetEngine() {
           Services.obs.removeObserver(observer, "browser-search-engine-modified");
           resolve();
           break;
       }
     }
 
     Services.obs.addObserver(observer, "browser-search-engine-modified");
     ss.addEngine("http://mochi.test:8888/browser/browser/components/search/test/426329.xml",
-                 null, "data:image/x-icon,%00", false);
+                 "data:image/x-icon,%00", false);
   });
 }
 
 function promiseRemoveEngine() {
   return new Promise(resolve => {
     var ss = Services.search;
 
     function observer(aSub, aTopic, aData) {
--- a/browser/components/search/test/browser_483086.js
+++ b/browser/components/search/test/browser_483086.js
@@ -19,17 +19,17 @@ function test() {
         Services.obs.removeObserver(observer, "browser-search-engine-modified");
         test2();
         break;
     }
   }
 
   Services.obs.addObserver(observer, "browser-search-engine-modified");
   gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/483086-1.xml",
-                null, "data:image/x-icon;%00", false);
+                "data:image/x-icon;%00", false);
 }
 
 function test2() {
   function observer(aSubject, aTopic, aData) {
     switch (aData) {
       case "engine-added":
         let engine = gSS.getEngineByName("483086b");
         ok(engine, "Test engine 2 installed");
@@ -40,10 +40,10 @@ function test2() {
         Services.obs.removeObserver(observer, "browser-search-engine-modified");
         finish();
         break;
     }
   }
 
   Services.obs.addObserver(observer, "browser-search-engine-modified");
   gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/483086-2.xml",
-                null, "data:image/x-icon;%00", false);
+                "data:image/x-icon;%00", false);
 }
--- a/browser/components/search/test/browser_addEngine.js
+++ b/browser/components/search/test/browser_addEngine.js
@@ -45,17 +45,17 @@ var gTests = [
       alias: null,
       description: "Foo Search",
       searchForm: "http://mochi.test:8888/browser/browser/components/search/test/",
     },
     run() {
       Services.obs.addObserver(observer, "browser-search-engine-modified");
 
       gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/testEngine.xml",
-                    null, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC",
+                    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC",
                     false);
     },
     added(engine) {
       ok(engine, "engine was added.");
 
       checkEngine(this.engine, engine);
 
       let engineFromSS = gSS.getEngineByName(this.engine.name);
--- a/browser/components/search/test/browser_contextmenu.js
+++ b/browser/components/search/test/browser_contextmenu.js
@@ -44,17 +44,17 @@ add_task(async function() {
             searchDonePromise();
           }
           break;
       }
     }
 
     Services.obs.addObserver(observer, "browser-search-engine-modified");
     ss.addEngine("resource://search-plugins/testEngine_mozsearch.xml",
-                 null, "data:image/x-icon,%00", false);
+                 "data:image/x-icon,%00", false);
   });
 
   contextMenu = document.getElementById("contentAreaContextMenu");
   ok(contextMenu, "Got context menu XUL");
 
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "data:text/plain;charset=utf8,test%20search");
 
   await ContentTask.spawn(tab.linkedBrowser, "", async function() {
--- a/browser/components/search/test/browser_healthreport.js
+++ b/browser/components/search/test/browser_healthreport.js
@@ -73,16 +73,16 @@ function test() {
         finish();
         break;
     }
   }
 
   Services.obs.addObserver(observer, "browser-search-engine-modified");
   gCUITestUtils.addSearchBar().then(function() {
     Services.search.addEngine("http://mochi.test:8888/browser/browser/components/search/test/testEngine.xml",
-                              null, "data:image/x-icon,%00", false);
+                              "data:image/x-icon,%00", false);
   });
 }
 
 function resetPreferences() {
   Preferences.resetBranch("datareporting.policy.");
   Preferences.set("datareporting.policy.dataSubmissionPolicyBypassNotification", true);
 }
--- a/browser/components/search/test/browser_hiddenOneOffs_cleanup.js
+++ b/browser/components/search/test/browser_hiddenOneOffs_cleanup.js
@@ -4,17 +4,17 @@
 const testPref = "Foo,FooDupe";
 
 function promiseNewEngine(basename) {
   return new Promise((resolve, reject) => {
     info("Waiting for engine to be added: " + basename);
     Services.search.init({
       onInitComplete() {
         let url = getRootDirectory(gTestPath) + basename;
-        Services.search.addEngine(url, null, "", false, {
+        Services.search.addEngine(url, "", false, {
           onSuccess(engine) {
             info("Search engine added: " + basename);
             resolve(engine);
           },
           onError(errCode) {
             ok(false, "addEngine failed with error code " + errCode);
             reject();
           },
--- a/browser/components/search/test/head.js
+++ b/browser/components/search/test/head.js
@@ -56,17 +56,17 @@ function promiseNewEngine(basename, opti
     // Default the setAsCurrent option to true.
     let setAsCurrent =
       options.setAsCurrent == undefined ? true : options.setAsCurrent;
     info("Waiting for engine to be added: " + basename);
     Services.search.init({
       onInitComplete() {
         let url = getRootDirectory(options.testPath || gTestPath) + basename;
         let current = Services.search.currentEngine;
-        Services.search.addEngine(url, null, options.iconURL || "", false, {
+        Services.search.addEngine(url, options.iconURL || "", false, {
           onSuccess(engine) {
             info("Search engine added: " + basename);
             if (setAsCurrent) {
               Services.search.currentEngine = engine;
             }
             registerCleanupFunction(() => {
               if (setAsCurrent) {
                 Services.search.currentEngine = current;
--- a/browser/modules/test/browser/browser_ContentSearch.js
+++ b/browser/modules/test/browser/browser_ContentSearch.js
@@ -330,17 +330,17 @@ function waitForNewEngine(mm, basename, 
   for (let i = 0; i < numImages; i++) {
     expectedSearchEvents.push("CurrentState");
   }
   let eventPromises = expectedSearchEvents.map(e => waitForTestMsg(mm, e));
 
   // Wait for addEngine().
   let addDeferred = PromiseUtils.defer();
   let url = getRootDirectory(gTestPath) + basename;
-  Services.search.addEngine(url, null, "", false, {
+  Services.search.addEngine(url, "", false, {
     onSuccess(engine) {
       info("Search engine added: " + basename);
       addDeferred.resolve(engine);
     },
     onError(errCode) {
       ok(false, "addEngine failed with error code " + errCode);
       addDeferred.reject();
     },
--- a/browser/modules/test/browser/browser_UsageTelemetry_searchbar.js
+++ b/browser/modules/test/browser/browser_UsageTelemetry_searchbar.js
@@ -181,17 +181,17 @@ add_task(async function test_oneOff_ente
   // Let's reset the counts.
   Services.telemetry.clearScalars();
   let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
 
   // Create an engine to generate search suggestions and add it as default
   // for this test.
   const url = getRootDirectory(gTestPath) + "usageTelemetrySearchSuggestions.xml";
   let suggestionEngine = await new Promise((resolve, reject) => {
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess(engine) { resolve(engine); },
       onError() { reject(); },
     });
   });
 
   let previousEngine = Services.search.currentEngine;
   Services.search.currentEngine = suggestionEngine;
 
@@ -249,17 +249,17 @@ add_task(async function test_suggestion_
   Services.telemetry.clearEvents();
   let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
   let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
 
   // Create an engine to generate search suggestions and add it as default
   // for this test.
   const url = getRootDirectory(gTestPath) + "usageTelemetrySearchSuggestions.xml";
   let suggestionEngine = await new Promise((resolve, reject) => {
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess(engine) { resolve(engine); },
       onError() { reject(); },
     });
   });
 
   let previousEngine = Services.search.currentEngine;
   Services.search.currentEngine = suggestionEngine;
 
@@ -306,17 +306,17 @@ add_task(async function test_suggestion_
   // Let's reset the counts.
   Services.telemetry.clearScalars();
   let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
 
   // Create an engine to generate search suggestions and add it as default
   // for this test.
   const url = getRootDirectory(gTestPath) + "usageTelemetrySearchSuggestions.xml";
   let suggestionEngine = await new Promise((resolve, reject) => {
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess(engine) { resolve(engine); },
       onError() { reject(); },
     });
   });
 
   let previousEngine = Services.search.currentEngine;
   Services.search.currentEngine = suggestionEngine;
 
--- a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
+++ b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
@@ -77,17 +77,17 @@ function clickURLBarSuggestion(entryName
 
 /**
  * Create an engine to generate search suggestions and add it as default
  * for this test.
  */
 async function withNewSearchEngine(taskFn) {
   const url = getRootDirectory(gTestPath) + "usageTelemetrySearchSuggestions.xml";
   let suggestionEngine = await new Promise((resolve, reject) => {
-    Services.search.addEngine(url, null, "", false, {
+    Services.search.addEngine(url, "", false, {
       onSuccess(engine) { resolve(engine); },
       onError() { reject(); },
     });
   });
 
   let previousEngine = Services.search.currentEngine;
   Services.search.currentEngine = suggestionEngine;
 
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -6018,17 +6018,17 @@ var SearchEngines = {
         };
 
         GlobalEventDispatcher.sendRequest(newEngineMessage);
       }
     });
   },
 
   addOpenSearchEngine: function addOpenSearchEngine(engine) {
-    Services.search.addEngine(engine.url, Ci.nsISearchEngine.DATA_XML, engine.iconURL, false, {
+    Services.search.addEngine(engine.url, engine.iconURL, false, {
       onSuccess: function() {
         // Display a toast confirming addition of new search engine.
         Snackbars.show(Strings.browser.formatStringFromName("alertSearchEngineAddedToast", [engine.title], 1), Snackbars.LENGTH_LONG);
       },
 
       onError: function(aCode) {
         let errorMessage;
         if (aCode == 2) {
--- a/mobile/android/tests/browser/chrome/test_device_search_engine.html
+++ b/mobile/android/tests/browser/chrome/test_device_search_engine.html
@@ -50,17 +50,17 @@ Migrated from Robocop: https://bugzilla.
   }
 
 SimpleTest.registerCleanupFunction(function() {
     Services.obs.removeObserver(search_observer, "browser-search-engine-modified");
   });
   Services.obs.addObserver(search_observer, "browser-search-engine-modified");
   info("Loading search engine");
   Services.search.addEngine("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/devicesearch.xml",
-                            null, null, false);
+                            null, false);
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861164">Mozilla Bug 861164</a>
 <br>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1184186">Migrated from Robocop testDeviceSearchEngine</a>
 <p id="display"></p>
--- a/netwerk/base/nsIBrowserSearchService.idl
+++ b/netwerk/base/nsIBrowserSearchService.idl
@@ -290,19 +290,16 @@ interface nsIBrowserSearchService : nsIS
    * Adds a new search engine from the file at the supplied URI, optionally
    * asking the user for confirmation first.  If a confirmation dialog is
    * shown, it will offer the option to begin using the newly added engine
    * right away.
    *
    * @param engineURL
    *        The URL to the search engine's description file.
    *
-   * @param dataType
-   *        Obsolete, the value is ignored.
-   *
    * @param iconURL
    *        A URL string to an icon file to be used as the search engine's
    *        icon. This value may be overridden by an icon specified in the
    *        engine description file.
    *
    * @param confirm
    *        A boolean value indicating whether the user should be asked for
    *        confirmation before this engine is added to the list.  If this
@@ -315,18 +312,18 @@ interface nsIBrowserSearchService : nsIS
    *        called if addEngine throws an exception.
    *
    * @param extensionID [optional]
    *        Optional: The correct extensionID if called by an add-on.
    *
    * @throws NS_ERROR_FAILURE if the description file cannot be successfully
    *         loaded.
    */
-  void addEngine(in AString engineURL, in long dataType, in AString iconURL,
-                 in boolean confirm, [optional] in nsISearchInstallCallback callback,
+  void addEngine(in AString engineURL, in AString iconURL, in boolean confirm,
+                 [optional] in nsISearchInstallCallback callback,
                  [optional] in AString extensionID);
 
   /**
    * Adds a new search engine, without asking the user for confirmation and
    * without starting to use it right away.
    *
    * @param name
    *        The search engine's name. Must be unique. Must not be null.
--- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
@@ -458,17 +458,17 @@ function addTestEngine(basename, httpSer
       }
 
       Services.obs.removeObserver(obs, "browser-search-engine-modified");
       registerCleanupFunction(() => Services.search.removeEngine(engine));
       resolve(engine);
     }, "browser-search-engine-modified");
 
     info("Adding engine from URL: " + dataUrl + basename);
-    Services.search.addEngine(dataUrl + basename, null, null, false);
+    Services.search.addEngine(dataUrl + basename, null, false);
   });
 }
 
 // Ensure we have a default search engine and the keyword.enabled preference
 // set.
 add_task(async function ensure_search_engine() {
   // keyword.enabled is necessary for the tests to see keyword searches.
   Services.prefs.setBoolPref("keyword.enabled", true);
--- a/toolkit/components/processsingleton/MainProcessSingleton.js
+++ b/toolkit/components/processsingleton/MainProcessSingleton.js
@@ -48,17 +48,17 @@ MainProcessSingleton.prototype = {
       Services.ww.getNewPrompter(browser.ownerGlobal).alert(title, msg);
       return;
     }
 
     Services.search.init(function(status) {
       if (status != Cr.NS_OK)
         return;
 
-      Services.search.addEngine(engineURL.spec, null, iconURL ? iconURL.spec : null, true);
+      Services.search.addEngine(engineURL.spec, iconURL ? iconURL.spec : null, true);
     });
   },
 
   observe(subject, topic, data) {
     switch (topic) {
     case "app-startup": {
       ChromeUtils.import("resource://gre/modules/CustomElementsListener.jsm", null);
       Services.obs.addObserver(this, "xpcom-shutdown");
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -3998,18 +3998,18 @@ SearchService.prototype = {
       suggestURL: searchProvider.suggest_url,
       suggestPostParams: searchProvider.suggest_url_post_params,
       queryCharset: "UTF-8",
       mozParams: searchProvider.params,
     };
     this.addEngineWithDetails(searchProvider.name.trim(), params);
   },
 
-  addEngine: function SRCH_SVC_addEngine(aEngineURL, aDataType, aIconURL,
-                                         aConfirm, aCallback, aExtensionID) {
+  addEngine: function SRCH_SVC_addEngine(aEngineURL, aIconURL, aConfirm,
+                                         aCallback, aExtensionID) {
     LOG("addEngine: Adding \"" + aEngineURL + "\".");
     this._ensureInitialized();
     try {
       var uri = makeURI(aEngineURL);
       var engine = new Engine(uri, false);
       if (aCallback) {
         engine._installCallback = function(errorCode) {
           try {
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -400,18 +400,17 @@ var addTestEngines = async function(aIte
           engines.push(engine);
           resolve();
         } catch (ex) {
           reject(ex);
         }
       }, "browser-search-engine-modified");
 
       if (item.xmlFileName) {
-        Services.search.addEngine(gDataUrl + item.xmlFileName,
-                                  null, null, false);
+        Services.search.addEngine(gDataUrl + item.xmlFileName, null, false);
       } else {
         Services.search.addEngineWithDetails(item.name, ...item.details);
       }
     });
   }
 
   return engines;
 };
--- a/toolkit/components/search/tests/xpcshell/test_addEngineWithExtensionID.js
+++ b/toolkit/components/search/tests/xpcshell/test_addEngineWithExtensionID.js
@@ -35,16 +35,16 @@ add_test(function test_addEngineWithExte
       Assert.equal(engine.wrappedJSObject._loadPath, kExtension2LoadPath);
       run_next_test();
     },
     onError(errorCode) {
       do_throw("search callback returned error: " + errorCode);
     },
   };
   Services.search.addEngine(gDataUrl + "engine.xml", null,
-                            null, false, searchCallback, kExtensionID2);
+                            false, searchCallback, kExtensionID2);
 });
 
 function run_test() {
   useHttpServer();
 
   run_next_test();
 }
--- a/toolkit/components/search/tests/xpcshell/test_addEngine_callback.js
+++ b/toolkit/components/search/tests/xpcshell/test_addEngine_callback.js
@@ -45,50 +45,50 @@ add_test(function simple_callback_test()
                    "[http]localhost/test-search-engine.xml");
       run_next_test();
     },
     onError(errorCode) {
       do_throw("search callback returned error: " + errorCode);
     },
   };
   Services.search.addEngine(gDataUrl + "engine.xml", null,
-                            null, false, searchCallback);
+                            false, searchCallback);
 });
 
 // Test of the search callback on duplicate engine failures
 add_test(function duplicate_failure_test() {
   let searchCallback = {
     onSuccess(engine) {
       do_throw("this addition should not have succeeded");
     },
     onError(errorCode) {
       Assert.ok(!!errorCode);
       Assert.equal(errorCode, Ci.nsISearchInstallCallback.ERROR_DUPLICATE_ENGINE);
       run_next_test();
     },
   };
   // Re-add the same engine added in the previous test
   Services.search.addEngine(gDataUrl + "engine.xml", null,
-                            null, false, searchCallback);
+                            false, searchCallback);
 });
 
 // Test of the search callback on failure to load the engine failures
 add_test(function load_failure_test() {
   let searchCallback = {
     onSuccess(engine) {
       do_throw("this addition should not have succeeded");
     },
     onError(errorCode) {
       Assert.ok(!!errorCode);
       Assert.equal(errorCode, Ci.nsISearchInstallCallback.ERROR_UNKNOWN_FAILURE);
       run_next_test();
     },
   };
   // Try adding an engine that doesn't exist
   Services.search.addEngine("http://invalid/data/engine.xml", null,
-                            null, false, searchCallback);
+                            false, searchCallback);
 });
 
 function run_test() {
   useHttpServer();
 
   run_next_test();
 }
--- a/toolkit/components/search/tests/xpcshell/test_multipleIcons.js
+++ b/toolkit/components/search/tests/xpcshell/test_multipleIcons.js
@@ -43,17 +43,17 @@ add_task(async function test_multipleIco
 
     return true;
   }));
 });
 
 add_task(async function test_icon_not_in_file() {
   let engineUrl = gDataUrl + "engine-fr.xml";
   let engine = await new Promise((resolve, reject) => {
-    Services.search.addEngine(engineUrl, null, "data:image/x-icon;base64,ico16",
+    Services.search.addEngine(engineUrl, "data:image/x-icon;base64,ico16",
                               false, {onSuccess: resolve, onError: reject});
   });
 
   // Even though the icon wasn't specified inside the XML file, it should be
   // available both in the iconURI attribute and with getIconURLBySize.
   Assert.ok(engine.iconURI.spec.includes("ico16"));
   Assert.ok(engine.getIconURLBySize(16, 16).includes("ico16"));
 });
--- a/toolkit/components/search/tests/xpcshell/test_notifications.js
+++ b/toolkit/components/search/tests/xpcshell/test_notifications.js
@@ -61,10 +61,10 @@ function run_test() {
   registerCleanupFunction(function cleanup() {
     Services.obs.removeObserver(search_observer, "browser-search-engine-modified");
   });
 
   do_test_pending();
 
   Services.obs.addObserver(search_observer, "browser-search-engine-modified");
 
-  Services.search.addEngine(gDataUrl + "engine.xml", null, null, false);
+  Services.search.addEngine(gDataUrl + "engine.xml", null, false);
 }
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -1604,17 +1604,17 @@ add_task(async function test_defaultSear
 
         Services.obs.removeObserver(obs, "browser-search-engine-modified");
         resolve(searchEngine);
       } catch (ex) {
         reject(ex);
       }
     }, "browser-search-engine-modified");
     Services.search.addEngine("file://" + do_get_cwd().path + "/engine.xml",
-                              null, null, false);
+                              null, false);
   });
   Services.search.defaultEngine = engine;
   await promise;
   TelemetryEnvironment.unregisterChangeListener("testWatch_SearchDefault");
   data = TelemetryEnvironment.currentEnvironment;
   checkEnvironmentData(data);
   Assert.deepEqual(data.settings.defaultSearchEngineData,
                    {"name": "engine-telemetry", "loadPath": "[other]/engine.xml", "origin": "verified"});