mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1555661 - Fix client code inclusion in Google urls. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D33157 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
9a419e5b3f
commit
29b4b129c5
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# don't change CLOBBER for WebIDL changes any more.
|
||||
|
||||
Bug 1551084 - Part 2. Make QCMS transform files use C++. r=miko
|
||||
Bug 1555661 - Clobber due to search engine file removals (bug 1552120)
|
||||
|
@ -1,26 +0,0 @@
|
||||
{
|
||||
"extensionName": {
|
||||
"message": "Google"
|
||||
},
|
||||
"extensionDescription": {
|
||||
"message": "Google Search"
|
||||
},
|
||||
"searchUrl": {
|
||||
"message": "https://www.google.com/search"
|
||||
},
|
||||
"searchForm": {
|
||||
"message": "https://www.google.com/search?q={searchTerms}"
|
||||
},
|
||||
"suggestUrl": {
|
||||
"message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "q={searchTerms}"
|
||||
},
|
||||
"param_keyword": {
|
||||
"message": "firefox-b-1-ab"
|
||||
},
|
||||
"param_searchbar": {
|
||||
"message": "firefox-b-1"
|
||||
}
|
||||
}
|
@ -16,5 +16,8 @@
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "client=firefox-b-1-d&q={searchTerms}"
|
||||
},
|
||||
"channelPref": {
|
||||
"message": "google_channel_us"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,5 +16,8 @@
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "client=firefox-b-1-e&q={searchTerms}"
|
||||
},
|
||||
"channelPref": {
|
||||
"message": "google_channel_us"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,5 +16,8 @@
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "client=firefox-b-d&q={searchTerms}"
|
||||
},
|
||||
"channelPref": {
|
||||
"message": "google_channel_row"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,5 +16,8 @@
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "client=firefox-b-e&q={searchTerms}"
|
||||
},
|
||||
"channelPref": {
|
||||
"message": "google_channel_row"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,18 +9,16 @@
|
||||
"message": "https://www.google.com/search"
|
||||
},
|
||||
"searchForm": {
|
||||
"message": "https://www.google.com/search?q={searchTerms}"
|
||||
"message": "https://www.google.com/search?client=firefox-b-d&q={searchTerms}"
|
||||
},
|
||||
"suggestUrl": {
|
||||
"message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
|
||||
},
|
||||
"searchUrlGetParams": {
|
||||
"message": "q={searchTerms}"
|
||||
"message": "client=firefox-b-d&q={searchTerms}"
|
||||
},
|
||||
"param_keyword": {
|
||||
"message": "firefox-b-ab"
|
||||
},
|
||||
"param_searchbar": {
|
||||
"message": "firefox-b"
|
||||
"channelPref": {
|
||||
"message": "google_channel_row"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,22 +23,10 @@
|
||||
"search_form": "__MSG_searchForm__",
|
||||
"suggest_url": "__MSG_suggestUrl__",
|
||||
"params": [
|
||||
{
|
||||
"name": "client",
|
||||
"condition": "purpose",
|
||||
"purpose": "keyword",
|
||||
"value": "__MSG_param_keyword__"
|
||||
},
|
||||
{
|
||||
"name": "client",
|
||||
"condition": "purpose",
|
||||
"purpose": "searchbar",
|
||||
"value": "__MSG_param_searchbar__"
|
||||
},
|
||||
{
|
||||
"name": "channel",
|
||||
"condition": "pref",
|
||||
"pref": "google_channel_us"
|
||||
"pref": "__MSG_channel_pref__"
|
||||
}
|
||||
],
|
||||
"search_url_get_params": "__MSG_searchUrlGetParams__"
|
||||
|
@ -403,8 +403,13 @@ class SearchConfigTest {
|
||||
const code = (typeof rules.codes === "string") ? rules.codes :
|
||||
rules.codes[purpose];
|
||||
const submission = engine.getSubmission("test", "text/html", purpose);
|
||||
this.assertOk(submission.uri.query.split("&").includes(code),
|
||||
const submissionQueryParams = submission.uri.query.split("&");
|
||||
this.assertOk(submissionQueryParams.includes(code),
|
||||
`Expected "${code}" in url "${submission.uri.spec}" from purpose "${purpose}" ${location}`);
|
||||
|
||||
const paramName = code.split("=")[0];
|
||||
this.assertOk(submissionQueryParams.filter(param => param.startsWith(paramName)).length == 1,
|
||||
`Expected only one "${paramName}" parameter in "${submission.uri.spec}" from purpose "${purpose}" ${location}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user