Skip to content

Commit

Permalink
Bug 1555661 - Fix client code inclusion in Google urls. r=daleharvey
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D33157

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Standard8 committed May 31, 2019
1 parent 365261e commit 7d395a9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 53 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -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)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-1-d&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_us"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-1-e&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_us"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-d&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_row"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"searchUrlGetParams": {
"message": "client=firefox-b-e&q={searchTerms}"
},
"channelPref": {
"message": "google_channel_row"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
"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"
}
}
}
14 changes: 1 addition & 13 deletions browser/components/search/extensions/google/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}

Expand Down

0 comments on commit 7d395a9

Please sign in to comment.