зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1481199 - Drop the obsolete dataType parameter for nsIBrowserSearchService.addEngine. r=mkaply
This commit is contained in:
Родитель
e60ca6394e
Коммит
45377e5099
|
@ -1175,7 +1175,7 @@ BrowserPageActions.addSearchEngine = {
|
|||
},
|
||||
|
||||
_installEngine(uri, image) {
|
||||
Services.search.addEngine(uri, null, image, false, {
|
||||
Services.search.addEngine(uri, image, false, {
|
||||
onSuccess: engine => {
|
||||
showBrowserPageActionFeedback(this.action);
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@ add_task(async function() {
|
|||
};
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -167,7 +167,7 @@ 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(() => {
|
||||
|
|
|
@ -22,7 +22,7 @@ add_task(async function setup() {
|
|||
});
|
||||
|
||||
Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
|
||||
null, null, false);
|
||||
null, false);
|
||||
|
||||
let [subject, data] = await engineAddedPromise;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ 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));
|
||||
|
|
|
@ -28,7 +28,7 @@ var SearchTestUtils = Object.freeze({
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -82,7 +82,7 @@ function promiseSetEngine() {
|
|||
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ function test() {
|
|||
|
||||
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() {
|
||||
|
@ -45,5 +45,5 @@ function test2() {
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ var gTests = [
|
|||
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) {
|
||||
|
|
|
@ -49,7 +49,7 @@ add_task(async function() {
|
|||
|
||||
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");
|
||||
|
|
|
@ -78,7 +78,7 @@ function test() {
|
|||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ function promiseNewEngine(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);
|
||||
|
|
|
@ -61,7 +61,7 @@ function promiseNewEngine(basename, options = {}) {
|
|||
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) {
|
||||
|
|
|
@ -335,7 +335,7 @@ function waitForNewEngine(mm, basename, numImages) {
|
|||
// 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);
|
||||
|
|
|
@ -186,7 +186,7 @@ add_task(async function test_oneOff_enterSelection() {
|
|||
// 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(); },
|
||||
});
|
||||
|
@ -254,7 +254,7 @@ add_task(async function test_suggestion_click() {
|
|||
// 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(); },
|
||||
});
|
||||
|
@ -311,7 +311,7 @@ add_task(async function test_suggestion_enterSelection() {
|
|||
// 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(); },
|
||||
});
|
||||
|
|
|
@ -82,7 +82,7 @@ function clickURLBarSuggestion(entryName, button = 1) {
|
|||
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(); },
|
||||
});
|
||||
|
|
|
@ -6023,7 +6023,7 @@ var SearchEngines = {
|
|||
},
|
||||
|
||||
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);
|
||||
|
|
|
@ -55,7 +55,7 @@ SimpleTest.registerCleanupFunction(function() {
|
|||
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>
|
||||
|
|
|
@ -295,9 +295,6 @@ interface nsIBrowserSearchService : nsISupports
|
|||
* @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
|
||||
|
@ -320,8 +317,8 @@ interface nsIBrowserSearchService : nsISupports
|
|||
* @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);
|
||||
|
||||
/**
|
||||
|
|
|
@ -463,7 +463,7 @@ function addTestEngine(basename, httpServer = undefined) {
|
|||
}, "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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ MainProcessSingleton.prototype = {
|
|||
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);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -4003,8 +4003,8 @@ SearchService.prototype = {
|
|||
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 {
|
||||
|
|
|
@ -405,8 +405,7 @@ var addTestEngines = async function(aItems) {
|
|||
}, "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);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ add_test(function test_addEngineWithExtensionID() {
|
|||
},
|
||||
};
|
||||
Services.search.addEngine(gDataUrl + "engine.xml", null,
|
||||
null, false, searchCallback, kExtensionID2);
|
||||
false, searchCallback, kExtensionID2);
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
|
|
|
@ -50,7 +50,7 @@ add_test(function simple_callback_test() {
|
|||
},
|
||||
};
|
||||
Services.search.addEngine(gDataUrl + "engine.xml", null,
|
||||
null, false, searchCallback);
|
||||
false, searchCallback);
|
||||
});
|
||||
|
||||
// Test of the search callback on duplicate engine failures
|
||||
|
@ -67,7 +67,7 @@ add_test(function duplicate_failure_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
|
||||
|
@ -84,7 +84,7 @@ add_test(function load_failure_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() {
|
||||
|
|
|
@ -48,7 +48,7 @@ add_task(async function test_multipleIcons() {
|
|||
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});
|
||||
});
|
||||
|
||||
|
|
|
@ -66,5 +66,5 @@ function run_test() {
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1609,7 +1609,7 @@ add_task(async function test_defaultSearchEngine() {
|
|||
}
|
||||
}, "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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче