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:
Mark Banner 2019-05-31 12:56:59 +00:00
parent 9a419e5b3f
commit 29b4b129c5
9 changed files with 30 additions and 53 deletions

View File

@ -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)

View File

@ -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"
}
}

View File

@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-1-d&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_us"
}
}
}

View File

@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-1-e&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_us"
}
}
}

View File

@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-d&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_row"
}
}
}

View File

@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-e&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_row"
}
}
}

View File

@ -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"
}
}
}

View File

@ -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__"

View File

@ -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}`);
}
}