Bug 1879410 - Remove Amazon from all regions except JP and US. r=mkaply

Differential Revision: https://phabricator.services.mozilla.com/D201165
This commit is contained in:
Mark Banner 2024-02-15 15:43:20 +00:00
parent 3b7b1eefce
commit fea8461bd8
2 changed files with 8 additions and 270 deletions

View File

@ -3,72 +3,6 @@
"use strict";
const mainShippedRegions = [
"at",
"au",
"be",
"ca",
"ch",
"cn",
"de",
"es",
"fr",
"mc",
"gb",
"ie",
"it",
"jp",
"nl",
"pt",
"se",
"sm",
"us",
"va",
];
const amazondotcomLocales = [
"ach",
"af",
"ar",
"az",
"bg",
"cak",
"cy",
"da",
"el",
"en-US",
"en-GB",
"eo",
"es-AR",
"eu",
"fa",
"ga-IE",
"gd",
"gl",
"gn",
"hr",
"hy-AM",
"ia",
"is",
"ka",
"km",
"lt",
"mk",
"ms",
"my",
"nb-NO",
"nn-NO",
"pt-PT",
"ro",
"si",
"sq",
"sr",
"th",
"tl",
"trs",
"uz",
];
const test = new SearchConfigTest({
identifier: "amazon",
default: {
@ -78,61 +12,11 @@ const test = new SearchConfigTest({
included: [
{
// The main regions we ship Amazon to. Below this are special cases.
regions: mainShippedRegions,
},
{
// Amazon.com ships to all of these locales, excluding the ones where
// we ship other items, but it does not matter that they are duplicated
// in the available list.
locales: amazondotcomLocales,
},
{
// Amazon.in
regions: ["in"],
locales: ["bn", "gu-IN", "kn", "mr", "pa-IN", "ta", "te", "ur"],
},
],
excluded: [
{
// Extra special case for cn as that only ships to the one locale.
regions: ["in"],
locales: amazondotcomLocales,
regions: ["us", "jp"],
},
],
},
details: [
{
domain: "amazon.com.au",
telemetryId: "amazon-au",
aliases: ["@amazon"],
included: [
{
regions: ["au"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.ca",
telemetryId: "amazon-ca",
aliases: ["@amazon"],
included: [
{
regions: ["ca"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.cn",
telemetryId: "amazondotcn",
included: [
{
regions: ["cn"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.co.jp",
telemetryId: "amazon-jp",
@ -145,17 +29,6 @@ const test = new SearchConfigTest({
searchUrlCode: "tag=mozillajapan-fx-22",
noSuggestionsURL: true,
},
{
domain: "amazon.co.uk",
telemetryId: "amazon-en-GB",
aliases: ["@amazon"],
included: [
{
regions: ["gb", "ie"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.com",
telemetryId: "amazondotcom-us",
@ -167,116 +40,6 @@ const test = new SearchConfigTest({
],
noSuggestionsURL: true,
},
{
domain: "amazon.com",
telemetryId: "amazondotcom",
aliases: ["@amazon"],
included: [
{
locales: amazondotcomLocales,
},
],
excluded: [{ regions: mainShippedRegions }],
noSuggestionsURL: true,
},
{
domain: "amazon.de",
telemetryId: "amazon-de",
aliases: ["@amazon"],
included: [
{
regions: ["at", "ch", "de"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.es",
telemetryId: "amazon-es",
aliases: ["@amazon"],
included: [
{
regions: ["es", "pt"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.fr",
telemetryId: "amazon-france",
aliases: ["@amazon"],
included: [
{
regions: ["fr", "mc"],
},
{
regions: ["be"],
locales: ["fr"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.in",
telemetryId: "amazon-in",
aliases: ["@amazon"],
included: [
{
locales: ["bn", "gu-IN", "kn", "mr", "pa-IN", "ta", "te", "ur"],
regions: ["in"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.it",
telemetryId: "amazon-it",
aliases: ["@amazon"],
included: [
{
regions: ["it", "sm", "va"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.nl",
telemetryId: "amazon-nl",
aliases: ["@amazon"],
included: [
{
regions: ["nl"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.nl",
telemetryId: "amazon-nl",
aliases: ["@amazon"],
included: [
{
regions: ["be"],
},
],
excluded: [
{
locales: ["fr"],
},
],
noSuggestionsURL: true,
},
{
domain: "amazon.se",
telemetryId: "amazon-se",
aliases: ["@amazon"],
included: [
{
regions: ["se"],
},
],
noSuggestionsURL: true,
},
],
});
@ -293,43 +56,18 @@ add_task(
{ skip_if: () => SearchUtils.newSearchConfigEnabled },
async function test_searchConfig_amazon_pre89() {
const version = "88.0";
if (SearchUtils.newSearchConfigEnabled) {
updateAppInfo({
name: "XPCShell",
ID: "xpcshell@tests.mozilla.org",
version,
platformVersion: version,
});
} else {
AddonTestUtils.createAppInfo(
"xpcshell@tests.mozilla.org",
"XPCShell",
version,
version
);
}
AddonTestUtils.createAppInfo(
"xpcshell@tests.mozilla.org",
"XPCShell",
version,
version
);
// For pre-89, Amazon has a slightly different config.
let details = test._config.details.find(
d => d.telemetryId == "amazondotcom-us"
);
details.telemetryId = "amazondotcom";
// nl not present due to urls that don't work.
let availableIn = test._config.available.included;
availableIn[0].regions = availableIn[0].regions.filter(
r => r != "be" && r != "nl"
);
availableIn.push({
regions: ["be"],
locales: ["fr"],
});
// Due to the way the exclusions work, no Amazon present in nl/be in the
// dot com locales for pre-89.
test._config.available.excluded[0].regions.push("be", "nl");
test._config.details = test._config.details.filter(
d => d.telemetryId != "amazon-nl"
);
await test.run();
}
);

View File

@ -56,7 +56,7 @@ tests.push({
region: "CN",
distribution: "MozillaOnline",
test: engines =>
hasEnginesFirst(engines, ["百度", "Bing", "Google", "亚马逊", "维基百科"]),
hasEnginesFirst(engines, ["百度", "Bing", "Google", "维基百科"]),
});
tests.push({