Bug 1598270 - Add support for MozParams on Google search engine in the modern configuration, and update the schema. r=mikedeboer

Differential Revision: https://phabricator.services.mozilla.com/D54114

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-11-21 21:54:14 +00:00
Родитель d0a29268be
Коммит 8f644aea91
4 изменённых файлов: 69 добавлений и 1 удалений

Просмотреть файл

@ -12,6 +12,11 @@
"q": "{searchTerms}"
}
},
"extraParams": [{
"name": "channel",
"condition": "pref",
"pref": "google_channel_row"
}],
"telemetryId": "google-b-d",
"appliesTo": [{
"included": { "everywhere": true },
@ -90,6 +95,11 @@
"q": "{searchTerms}"
}
},
"extraParams": [{
"name": "channel",
"condition": "pref",
"pref": "google_channel_us"
}],
"telemetryId": "google-b-1-d"
}, {
"included": { "regions": ["us"] },
@ -102,6 +112,11 @@
"q": "{searchTerms}"
}
},
"extraParams": [{
"name": "channel",
"condition": "pref",
"pref": "google_channel_us"
}],
"telemetryId": "google-b-1-e"
}]
},

Просмотреть файл

@ -31,6 +31,9 @@
},
"params": {
"$ref": "#/definitions/params"
},
"extraParams": {
"$ref": "#/definitions/extraParams"
}
},
"definitions": {
@ -97,6 +100,52 @@
"no"
]
},
"extraParams": {
"type": "array",
"title": "Extra Parameters",
"description": "Extra parameters for the search engine (aka MozParams)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "Name of the parameter that will be used in the search query"
},
"condition": {
"type": "string",
"title": "Condition",
"description": "The type of parameter (pref or purpose)",
"enum": [
"pref",
"purpose"
]
},
"purpose": {
"type": "string",
"title": "Purpose",
"description": "The search purpose that triggers this parameter being appended.",
"enum": [
"searchbar",
"keyword",
"contextmenu",
"homepage",
"newtab"
]
},
"value": {
"type": "string",
"title": "Value",
"description": "If this is a purpose type, the value is used as the value of the parameter in the query"
},
"pref": {
"type": "string",
"title": "Preference name",
"description": "The preference name to get the value from (i.e. browser.search.param.<preference name>)."
}
}
}
},
"orderHint": {
"type": "number",
"title": "Order Hint",
@ -308,6 +357,9 @@
},
"params": {
"$ref": "#/definitions/params"
},
"extraParams": {
"$ref": "#/definitions/extraParams"
}
}
}

Просмотреть файл

@ -6,6 +6,7 @@
"orderHint",
"telemetryId",
"params",
"extraParams",
"appliesTo"
]
}

Просмотреть файл

@ -98,7 +98,7 @@ add_task(async function test_searchConfig_google_with_mozparam() {
// TODO: Bug 1598270 will add the true option here, to test for the selector,
// aka modern configuration.
for (const useSelector of [false]) {
for (const useSelector of [false, true]) {
info("Using " + (useSelector ? "Selector" : "Legacy Configuration"));
for (const testData of TEST_DATA) {
info(`Checking region ${testData.region}, locale ${testData.locale}`);