зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1654348 - Remove obsolete browser_<enginename>.js tests r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D84569
This commit is contained in:
Родитель
81afea999f
Коммит
acc03ec147
|
@ -21,8 +21,6 @@ support-files =
|
|||
[browser_426329.js]
|
||||
[browser_483086.js]
|
||||
[browser_addEngine.js]
|
||||
[browser_amazon.js]
|
||||
[browser_bing.js]
|
||||
[browser_contentContextMenu.js]
|
||||
support-files = browser_contentContextMenu.xhtml
|
||||
[browser_contextmenu.js]
|
||||
|
@ -30,9 +28,6 @@ support-files = mozsearch/mozsearch-engine-private/manifest.json
|
|||
skip-if = (os == "win" && processor == "aarch64") # disabled on aarch64 due to 1531590
|
||||
[browser_contextSearchTabPosition.js]
|
||||
skip-if = verify && debug && os == 'win' # Bug 1412519
|
||||
[browser_ddg.js]
|
||||
[browser_eBay.js]
|
||||
[browser_google.js]
|
||||
[browser_google_behavior.js]
|
||||
[browser_healthreport.js]
|
||||
skip-if = (verify && debug && (os == 'win' || os == 'linux'))
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test Amazon search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function test() {
|
||||
await Services.search.init();
|
||||
|
||||
let engine = Services.search.getEngineByName("Amazon.com");
|
||||
ok(engine, "Amazon.com");
|
||||
|
||||
let base =
|
||||
"https://www.amazon.com/exec/obidos/external-search/?field-keywords=foo&ie=UTF-8&mode=blended&tag=mozilla-20&sourceid=Mozilla-search";
|
||||
let url;
|
||||
|
||||
// Test search URLs (including purposes).
|
||||
url = engine.getSubmission("foo").uri.spec;
|
||||
is(url, base, "Check search URL for 'foo'");
|
||||
|
||||
// Check search suggestion URL.
|
||||
url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;
|
||||
is(
|
||||
url,
|
||||
"https://completion.amazon.com/search/complete?q=foo&search-alias=aps&mkt=1",
|
||||
"Check search suggestion URL for 'foo'"
|
||||
);
|
||||
|
||||
// Check all other engine properties.
|
||||
const EXPECTED_ENGINE = {
|
||||
name: "Amazon.com",
|
||||
alias: null,
|
||||
hidden: false,
|
||||
wrappedJSObject: {
|
||||
queryCharset: "UTF-8",
|
||||
_urls: [
|
||||
{
|
||||
type: "text/html",
|
||||
method: "GET",
|
||||
template: "https://www.amazon.com/exec/obidos/external-search/",
|
||||
params: [
|
||||
{
|
||||
name: "field-keywords",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "ie",
|
||||
value: "{inputEncoding}",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "mode",
|
||||
value: "blended",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "tag",
|
||||
value: "mozilla-20",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "sourceid",
|
||||
value: "Mozilla-search",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "application/x-suggestions+json",
|
||||
method: "GET",
|
||||
template:
|
||||
"https://completion.amazon.com/search/complete?q={searchTerms}&search-alias=aps&mkt=1",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
isSubObjectOf(EXPECTED_ENGINE, engine, "Amazon");
|
||||
});
|
|
@ -1,125 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test Bing search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function test() {
|
||||
await Services.search.init();
|
||||
|
||||
let engine = Services.search.getEngineByName("Bing");
|
||||
ok(engine, "Bing");
|
||||
|
||||
let base = "https://www.bing.com/search?form={code}&pc=MOZI&q=foo";
|
||||
let url;
|
||||
|
||||
function getUrl(code) {
|
||||
return base.replace("{code}", code);
|
||||
}
|
||||
|
||||
// Test search URLs (including purposes).
|
||||
url = engine.getSubmission("foo").uri.spec;
|
||||
is(url, getUrl("MOZSBR"), "Check search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
|
||||
is(url, getUrl("MOZCON"), "Check context menu search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "keyword").uri.spec;
|
||||
is(url, getUrl("MOZLBR"), "Check keyword search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "searchbar").uri.spec;
|
||||
is(url, getUrl("MOZSBR"), "Check search bar search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "homepage").uri.spec;
|
||||
is(url, getUrl("MOZSPG"), "Check homepage search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "newtab").uri.spec;
|
||||
is(url, getUrl("MOZTSB"), "Check newtab search URL for 'foo'");
|
||||
|
||||
// Check search suggestion URL.
|
||||
url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;
|
||||
is(
|
||||
url,
|
||||
"https://www.bing.com/osjson.aspx?query=foo&form=OSDJAS&language=" +
|
||||
getLocale(),
|
||||
"Check search suggestion URL for 'foo'"
|
||||
);
|
||||
|
||||
// Check all other engine properties.
|
||||
const EXPECTED_ENGINE = {
|
||||
name: "Bing",
|
||||
alias: null,
|
||||
description: "Bing. Search by Microsoft.",
|
||||
searchForm: "https://www.bing.com/search?pc=MOZI&q=",
|
||||
hidden: false,
|
||||
wrappedJSObject: {
|
||||
queryCharset: "UTF-8",
|
||||
_urls: [
|
||||
{
|
||||
type: "text/html",
|
||||
method: "GET",
|
||||
template: "https://www.bing.com/search",
|
||||
params: [
|
||||
{
|
||||
name: "form",
|
||||
value: "MOZCON",
|
||||
purpose: "contextmenu",
|
||||
},
|
||||
{
|
||||
name: "form",
|
||||
value: "MOZSBR",
|
||||
purpose: "searchbar",
|
||||
},
|
||||
{
|
||||
name: "form",
|
||||
value: "MOZSPG",
|
||||
purpose: "homepage",
|
||||
},
|
||||
{
|
||||
name: "form",
|
||||
value: "MOZLBR",
|
||||
purpose: "keyword",
|
||||
},
|
||||
{
|
||||
name: "form",
|
||||
value: "MOZTSB",
|
||||
purpose: "newtab",
|
||||
},
|
||||
{
|
||||
name: "pc",
|
||||
value: "MOZI",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "q",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "application/x-suggestions+json",
|
||||
method: "GET",
|
||||
template: "https://www.bing.com/osjson.aspx",
|
||||
params: [
|
||||
{
|
||||
name: "query",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "form",
|
||||
value: "OSDJAS",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "language",
|
||||
value: "{moz:locale}",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
isSubObjectOf(EXPECTED_ENGINE, engine, "Bing");
|
||||
});
|
|
@ -1,114 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test DuckDuckGo search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function test() {
|
||||
await Services.search.init();
|
||||
|
||||
let engine = Services.search.getEngineByName("DuckDuckGo");
|
||||
ok(engine, "DuckDuckGo");
|
||||
|
||||
let base = "https://duckduckgo.com/?t={code}&q=foo";
|
||||
let url;
|
||||
|
||||
function getUrl(code) {
|
||||
return base.replace("{code}", code);
|
||||
}
|
||||
|
||||
// Test search URLs (including purposes).
|
||||
url = engine.getSubmission("foo").uri.spec;
|
||||
is(url, getUrl("ffsb"), "Check search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
|
||||
is(url, getUrl("ffcm"), "Check context menu search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "keyword").uri.spec;
|
||||
is(url, getUrl("ffab"), "Check keyword search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "searchbar").uri.spec;
|
||||
is(url, getUrl("ffsb"), "Check search bar search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "homepage").uri.spec;
|
||||
is(url, getUrl("ffhp"), "Check homepage search URL for 'foo'");
|
||||
url = engine.getSubmission("foo", null, "newtab").uri.spec;
|
||||
is(url, getUrl("ffnt"), "Check newtab search URL for 'foo'");
|
||||
|
||||
// Check search suggestion URL.
|
||||
url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;
|
||||
is(
|
||||
url,
|
||||
"https://ac.duckduckgo.com/ac/?q=foo&type=list",
|
||||
"Check search suggestion URL for 'foo'"
|
||||
);
|
||||
|
||||
// Check all other engine properties.
|
||||
const EXPECTED_ENGINE = {
|
||||
name: "DuckDuckGo",
|
||||
alias: null,
|
||||
description: "Search DuckDuckGo",
|
||||
searchForm: "https://duckduckgo.com/?q=",
|
||||
hidden: false,
|
||||
wrappedJSObject: {
|
||||
queryCharset: "UTF-8",
|
||||
_urls: [
|
||||
{
|
||||
type: "text/html",
|
||||
method: "GET",
|
||||
template: "https://duckduckgo.com/",
|
||||
params: [
|
||||
{
|
||||
name: "t",
|
||||
value: "ffcm",
|
||||
purpose: "contextmenu",
|
||||
},
|
||||
{
|
||||
name: "t",
|
||||
value: "ffab",
|
||||
purpose: "keyword",
|
||||
},
|
||||
{
|
||||
name: "t",
|
||||
value: "ffsb",
|
||||
purpose: "searchbar",
|
||||
},
|
||||
{
|
||||
name: "t",
|
||||
value: "ffhp",
|
||||
purpose: "homepage",
|
||||
},
|
||||
{
|
||||
name: "t",
|
||||
value: "ffnt",
|
||||
purpose: "newtab",
|
||||
},
|
||||
{
|
||||
name: "q",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "application/x-suggestions+json",
|
||||
method: "GET",
|
||||
template: "https://ac.duckduckgo.com/ac/",
|
||||
params: [
|
||||
{
|
||||
name: "q",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
value: "list",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
isSubObjectOf(EXPECTED_ENGINE, engine, "DuckDuckGo");
|
||||
});
|
|
@ -1,92 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test eBay search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function test() {
|
||||
await Services.search.init();
|
||||
|
||||
let engine = Services.search.getEngineByName("eBay");
|
||||
ok(engine, "eBay");
|
||||
|
||||
let base =
|
||||
"https://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=20004&campid=5338192028&customid=&mpre=https://www.ebay.com/sch/foo";
|
||||
let url;
|
||||
|
||||
// Test search URLs (including purposes).
|
||||
url = engine.getSubmission("foo").uri.spec;
|
||||
is(url, base, "Check search URL for 'foo'");
|
||||
|
||||
// Check all other engine properties.
|
||||
const EXPECTED_ENGINE = {
|
||||
name: "eBay",
|
||||
alias: null,
|
||||
description: "eBay - Online auctions",
|
||||
searchForm: "https://www.ebay.com/",
|
||||
hidden: false,
|
||||
wrappedJSObject: {
|
||||
_urls: [
|
||||
{
|
||||
type: "text/html",
|
||||
method: "GET",
|
||||
template: "https://rover.ebay.com/rover/1/711-53200-19255-0/1",
|
||||
params: [
|
||||
{
|
||||
name: "ff3",
|
||||
value: "4",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "toolid",
|
||||
value: "20004",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "campid",
|
||||
value: "5338192028",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "customid",
|
||||
value: "",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "mpre",
|
||||
value: "https://www.ebay.com/sch/{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "application/x-suggestions+json",
|
||||
method: "GET",
|
||||
template: "https://autosug.ebay.com/autosug",
|
||||
params: [
|
||||
{
|
||||
name: "sId",
|
||||
value: "0",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "fmt",
|
||||
value: "osr",
|
||||
purpose: undefined,
|
||||
},
|
||||
{
|
||||
name: "kwd",
|
||||
value: "{searchTerms}",
|
||||
purpose: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
isSubObjectOf(EXPECTED_ENGINE, engine, "eBay");
|
||||
});
|
|
@ -1,49 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* Test Google search plugin URLs
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
let expectedEngine = {
|
||||
name: "Google",
|
||||
alias: null,
|
||||
description: "Google Search",
|
||||
hidden: false,
|
||||
};
|
||||
|
||||
add_task(async function test() {
|
||||
await Services.search.init();
|
||||
|
||||
let engine = Services.search.getEngineByName("Google");
|
||||
ok(engine, "Found Google search engine");
|
||||
|
||||
// Check search suggestion URL.
|
||||
// This also checks that the query is on the end of the URL. See bug 1484232.
|
||||
let url = engine.getSubmission("foo", "application/x-suggestions+json").uri
|
||||
.spec;
|
||||
is(
|
||||
url,
|
||||
"https://www.google.com/complete/search?client=firefox&q=foo",
|
||||
"Check search suggestion URL for 'foo'"
|
||||
);
|
||||
|
||||
// Check result parsing and alternate domains.
|
||||
let base = "https://www.google.com/search?q=foo";
|
||||
is(
|
||||
Services.search.parseSubmissionURL(base).terms,
|
||||
"foo",
|
||||
"Check result parsing"
|
||||
);
|
||||
let alternateBase = base.replace("www.google.com", "www.google.fr");
|
||||
is(
|
||||
Services.search.parseSubmissionURL(alternateBase).terms,
|
||||
"foo",
|
||||
"Check alternate domain"
|
||||
);
|
||||
|
||||
// Check all other engine properties.
|
||||
isSubObjectOf(expectedEngine, engine, "Google");
|
||||
});
|
|
@ -3,5 +3,4 @@ prefs =
|
|||
browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar=false
|
||||
browser.search.region='DE'
|
||||
|
||||
[../browser_google.js]
|
||||
[../browser_google_behavior.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче