Bug 1555661 - Fix client code inclusion in Google urls. r=daleharvey
authorMark Banner <standard8@mozilla.com>
Fri, 31 May 2019 12:56:59 +0000
changeset 476363 70d1aed471491825c66bb5da924dd88006445ab3
parent 476362 3a5ec7efe864b5cd3e351716896e6da017830b76
child 476364 7a8bb795a4c936576dbd9892c528faa671e6a1c2
push id36092
push userarchaeopteryx@coole-files.de
push dateFri, 31 May 2019 17:03:46 +0000
treeherdermozilla-central@8384972e1f6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaleharvey
bugs1555661
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1555661 - Fix client code inclusion in Google urls. r=daleharvey Differential Revision: https://phabricator.services.mozilla.com/D33157
CLOBBER
browser/components/search/extensions/google/_locales/2018/messages.json
browser/components/search/extensions/google/_locales/b-1-d/messages.json
browser/components/search/extensions/google/_locales/b-1-e/messages.json
browser/components/search/extensions/google/_locales/b-d/messages.json
browser/components/search/extensions/google/_locales/b-e/messages.json
browser/components/search/extensions/google/_locales/en/messages.json
browser/components/search/extensions/google/manifest.json
toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # 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)
deleted file mode 100644
--- a/browser/components/search/extensions/google/_locales/2018/messages.json
+++ /dev/null
@@ -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"
-  }
-}
\ No newline at end of file
--- a/browser/components/search/extensions/google/_locales/b-1-d/messages.json
+++ b/browser/components/search/extensions/google/_locales/b-1-d/messages.json
@@ -11,10 +11,13 @@
   "searchForm": {
     "message": "https://www.google.com/search?client=firefox-b-1-d&q={searchTerms}"
   },
   "suggestUrl": {
     "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
   },
   "searchUrlGetParams": {
     "message": "client=firefox-b-1-d&q={searchTerms}"
+  },
+  "channelPref": {
+    "message": "google_channel_us"
   }
-}
\ No newline at end of file
+}
--- a/browser/components/search/extensions/google/_locales/b-1-e/messages.json
+++ b/browser/components/search/extensions/google/_locales/b-1-e/messages.json
@@ -11,10 +11,13 @@
   "searchForm": {
     "message": "https://www.google.com/search?client=firefox-b-1-e&q={searchTerms}"
   },
   "suggestUrl": {
     "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
   },
   "searchUrlGetParams": {
     "message": "client=firefox-b-1-e&q={searchTerms}"
+  },
+  "channelPref": {
+    "message": "google_channel_us"
   }
-}
\ No newline at end of file
+}
--- a/browser/components/search/extensions/google/_locales/b-d/messages.json
+++ b/browser/components/search/extensions/google/_locales/b-d/messages.json
@@ -11,10 +11,13 @@
   "searchForm": {
     "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": "client=firefox-b-d&q={searchTerms}"
+  },
+  "channelPref": {
+    "message": "google_channel_row"
   }
-}
\ No newline at end of file
+}
--- a/browser/components/search/extensions/google/_locales/b-e/messages.json
+++ b/browser/components/search/extensions/google/_locales/b-e/messages.json
@@ -11,10 +11,13 @@
   "searchForm": {
     "message": "https://www.google.com/search?client=firefox-b-e&q={searchTerms}"
   },
   "suggestUrl": {
     "message": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"
   },
   "searchUrlGetParams": {
     "message": "client=firefox-b-e&q={searchTerms}"
+  },
+  "channelPref": {
+    "message": "google_channel_row"
   }
-}
\ No newline at end of file
+}
--- a/browser/components/search/extensions/google/_locales/en/messages.json
+++ b/browser/components/search/extensions/google/_locales/en/messages.json
@@ -4,23 +4,21 @@
   },
   "extensionDescription": {
     "message": "Google Search"
   },
   "searchUrl": {
     "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}"
-  },
-  "param_keyword": {
-    "message": "firefox-b-ab"
+    "message": "client=firefox-b-d&q={searchTerms}"
   },
-  "param_searchbar": {
-    "message": "firefox-b"
+  "channelPref": {
+    "message": "google_channel_row"
   }
-}
\ No newline at end of file
+
+}
--- a/browser/components/search/extensions/google/manifest.json
+++ b/browser/components/search/extensions/google/manifest.json
@@ -19,29 +19,17 @@
   "chrome_settings_overrides": {
     "search_provider": {
       "name": "__MSG_extensionName__",
       "search_url": "__MSG_searchUrl__",
       "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__"
     }
   }
 }
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
@@ -398,18 +398,23 @@ class SearchConfigTest {
    *   Rules to test.
    */
   _assertCorrectCodes(location, engine, rules) {
     for (const purpose of SUBMISSION_PURPOSES) {
       // Don't need to repeat the code if we use it for all purposes.
       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}`);
     }
   }
 
   /**
    * Asserts whether the engine is using the correct URL codes or not.
    *
    * @param {string} location
    *   Debug string with locale + region information.