зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b24238e8e714 (bug 1481199) for failures in mobile/android/tests/browser/chrome/test_device_search_engine.html
This commit is contained in:
Родитель
17741f0004
Коммит
d9cb8a1d4a
|
@ -1162,7 +1162,7 @@ BrowserPageActions.addSearchEngine = {
|
|||
},
|
||||
|
||||
_installEngine(uri, image) {
|
||||
Services.search.addEngine(uri, image, false, {
|
||||
Services.search.addEngine(uri, null, 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, false);
|
||||
null, 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", false, {
|
||||
onSuccess(engine) {
|
||||
info("Search engine added: " + basename);
|
||||
registerCleanupFunction(() => {
|
||||
|
|
|
@ -50,7 +50,7 @@ function test() {
|
|||
});
|
||||
|
||||
Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
|
||||
null, false);
|
||||
null, null, false);
|
||||
}
|
||||
|
||||
var gCurrTest;
|
||||
|
|
|
@ -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, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", false, {
|
||||
onSuccess(engine) {
|
||||
gTestGlobals.registerCleanupFunction(() => Services.search.removeEngine(engine));
|
||||
resolve(engine);
|
||||
|
|
|
@ -83,7 +83,7 @@ function promiseSetEngine() {
|
|||
|
||||
Services.obs.addObserver(observer, "browser-search-engine-modified");
|
||||
ss.addEngine("http://mochi.test:8888/browser/browser/components/search/test/426329.xml",
|
||||
"data:image/x-icon,%00", false);
|
||||
null, "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",
|
||||
"data:image/x-icon;%00", false);
|
||||
null, "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",
|
||||
"data:image/x-icon;%00", false);
|
||||
null, "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",
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC",
|
||||
null, "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",
|
||||
"data:image/x-icon,%00", false);
|
||||
null, "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",
|
||||
"data:image/x-icon,%00", false);
|
||||
null, "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, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, options.iconURL || "", false, {
|
||||
Services.search.addEngine(url, null, options.iconURL || "", false, {
|
||||
onSuccess(engine) {
|
||||
info("Search engine added: " + basename);
|
||||
if (setAsCurrent) {
|
||||
|
|
|
@ -335,7 +335,7 @@ function waitForNewEngine(basename, numImages) {
|
|||
// Wait for addEngine().
|
||||
let addDeferred = PromiseUtils.defer();
|
||||
let url = getRootDirectory(gTestPath) + basename;
|
||||
Services.search.addEngine(url, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", 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, "", false, {
|
||||
Services.search.addEngine(url, null, "", false, {
|
||||
onSuccess(engine) { resolve(engine); },
|
||||
onError() { reject(); }
|
||||
});
|
||||
|
|
|
@ -5990,7 +5990,7 @@ var SearchEngines = {
|
|||
},
|
||||
|
||||
addOpenSearchEngine: function addOpenSearchEngine(engine) {
|
||||
Services.search.addEngine(engine.url, engine.iconURL, false, {
|
||||
Services.search.addEngine(engine.url, Ci.nsISearchEngine.DATA_XML, 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);
|
||||
|
|
|
@ -295,6 +295,9 @@ 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
|
||||
|
@ -317,8 +320,8 @@ interface nsIBrowserSearchService : nsISupports
|
|||
* @throws NS_ERROR_FAILURE if the description file cannot be successfully
|
||||
* loaded.
|
||||
*/
|
||||
void addEngine(in AString engineURL, in AString iconURL, in boolean confirm,
|
||||
[optional] in nsISearchInstallCallback callback,
|
||||
void addEngine(in AString engineURL, in long dataType, in AString iconURL,
|
||||
in boolean confirm, [optional] in nsISearchInstallCallback callback,
|
||||
[optional] in AString extensionID);
|
||||
|
||||
/**
|
||||
|
|
|
@ -462,7 +462,7 @@ function addTestEngine(basename, httpServer = undefined) {
|
|||
}, "browser-search-engine-modified");
|
||||
|
||||
info("Adding engine from URL: " + dataUrl + basename);
|
||||
Services.search.addEngine(dataUrl + basename, null, false);
|
||||
Services.search.addEngine(dataUrl + basename, null, null, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ MainProcessSingleton.prototype = {
|
|||
if (status != Cr.NS_OK)
|
||||
return;
|
||||
|
||||
Services.search.addEngine(engineURL.spec, iconURL ? iconURL.spec : null, true);
|
||||
Services.search.addEngine(engineURL.spec, null, iconURL ? iconURL.spec : null, true);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -3848,8 +3848,8 @@ SearchService.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
addEngine: function SRCH_SVC_addEngine(aEngineURL, aIconURL, aConfirm,
|
||||
aCallback, aExtensionID) {
|
||||
addEngine: function SRCH_SVC_addEngine(aEngineURL, aDataType, aIconURL,
|
||||
aConfirm, aCallback, aExtensionID) {
|
||||
LOG("addEngine: Adding \"" + aEngineURL + "\".");
|
||||
this._ensureInitialized();
|
||||
try {
|
||||
|
|
|
@ -415,7 +415,8 @@ var addTestEngines = async function(aItems) {
|
|||
}, "browser-search-engine-modified");
|
||||
|
||||
if (item.xmlFileName) {
|
||||
Services.search.addEngine(gDataUrl + item.xmlFileName, null, false);
|
||||
Services.search.addEngine(gDataUrl + item.xmlFileName,
|
||||
null, 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,
|
||||
false, searchCallback, kExtensionID2);
|
||||
null, false, searchCallback, kExtensionID2);
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
|
|
|
@ -50,7 +50,7 @@ add_test(function simple_callback_test() {
|
|||
}
|
||||
};
|
||||
Services.search.addEngine(gDataUrl + "engine.xml", null,
|
||||
false, searchCallback);
|
||||
null, 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,
|
||||
false, searchCallback);
|
||||
null, 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,
|
||||
false, searchCallback);
|
||||
null, 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, "data:image/x-icon;base64,ico16",
|
||||
Services.search.addEngine(engineUrl, null, "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, false);
|
||||
Services.search.addEngine(gDataUrl + "engine.xml", null, null, false);
|
||||
}
|
||||
|
|
|
@ -1610,7 +1610,7 @@ add_task(async function test_defaultSearchEngine() {
|
|||
}
|
||||
}, "browser-search-engine-modified");
|
||||
Services.search.addEngine("file://" + do_get_cwd().path + "/engine.xml",
|
||||
null, false);
|
||||
null, null, false);
|
||||
});
|
||||
Services.search.defaultEngine = engine;
|
||||
await promise;
|
||||
|
|
Загрузка…
Ссылка в новой задаче