Bug 1417678 - New search defaults for browser and mobile. r=florian,mconnor a=lizzard l10n=flod DEVEDITION_58_0b12_RELEASE FENNEC_58_0b12_BUILD1 FENNEC_58_0b12_RELEASE FIREFOX_58_0b12_BUILD1 FIREFOX_58_0b12_RELEASE
authorMichael Kaply <mozilla@kaply.com>
Fri, 01 Dec 2017 11:43:54 -0600
changeset 445381 a59d9203232dce3e42ba3aba74cf52915fb9ce61
parent 445380 61f67c434ca4b58c02ada52ceeb839ec206999a2
child 445382 f31109c74b9adf0ac433c11fb9d6457eec56d076
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, mconnor, lizzard
bugs1417678
milestone58.0
Bug 1417678 - New search defaults for browser and mobile. r=florian,mconnor a=lizzard l10n=flod MozReview-Commit-ID: FP9f7QbXZAV
browser/app/profile/firefox.js
browser/components/search/moz.build
browser/components/search/test/browser.ini
browser/components/search/test/browser_google.js
browser/components/search/test/browser_google_behavior.js
browser/components/search/test/browser_google_codes.js
browser/components/search/test/browser_google_nocodes.js
browser/components/search/test/google_codes/browser.ini
browser/components/search/test/google_nocodes/browser.ini
browser/locales/search/list.json
mobile/locales/en-US/chrome/region.properties
mobile/locales/search/list.json
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -392,19 +392,19 @@ pref("browser.search.order.3",          
 
 // Market-specific search defaults
 // This is disabled globally, and then enabled for individual locales
 // in firefox-l10n.js (eg. it's enabled for en-US).
 pref("browser.search.geoSpecificDefaults", false);
 pref("browser.search.geoSpecificDefaults.url", "https://search.services.mozilla.com/1/%APP%/%VERSION%/%CHANNEL%/%LOCALE%/%REGION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%");
 
 // US specific default (used as a fallback if the geoSpecificDefaults request fails).
-pref("browser.search.defaultenginename.US",      "data:text/plain,browser.search.defaultenginename.US=Yahoo");
-pref("browser.search.order.US.1",                "data:text/plain,browser.search.order.US.1=Yahoo");
-pref("browser.search.order.US.2",                "data:text/plain,browser.search.order.US.2=Google");
+pref("browser.search.defaultenginename.US",      "data:text/plain,browser.search.defaultenginename.US=Google");
+pref("browser.search.order.US.1",                "data:text/plain,browser.search.order.US.1=Google");
+pref("browser.search.order.US.2",                "data:text/plain,browser.search.order.US.2=Yahoo");
 pref("browser.search.order.US.3",                "data:text/plain,browser.search.order.US.3=Bing");
 
 // search bar results always open in a new tab
 pref("browser.search.openintab", false);
 
 // context menu searches open in the foreground
 pref("browser.search.context.loadInBackground", false);
 
--- a/browser/components/search/moz.build
+++ b/browser/components/search/moz.build
@@ -1,14 +1,16 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini',
+    'test/google_codes/browser.ini',
+    'test/google_nocodes/browser.ini',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Search')
--- a/browser/components/search/test/browser.ini
+++ b/browser/components/search/test/browser.ini
@@ -22,20 +22,16 @@ support-files =
 [browser_contextmenu.js]
 [browser_contextSearchTabPosition.js]
 skip-if = os == "mac" # bug 967013
 [browser_ddg.js]
 [browser_eBay.js]
 skip-if = artifact # bug 1315953
 [browser_google.js]
 skip-if = artifact # bug 1315953
-[browser_google_codes.js]
-skip-if = artifact # bug 1315953
-[browser_google_nocodes.js]
-skip-if = artifact # bug 1315953
 [browser_google_behavior.js]
 skip-if = artifact # bug 1315953
 [browser_healthreport.js]
 [browser_hiddenOneOffs_cleanup.js]
 [browser_hiddenOneOffs_diacritics.js]
 [browser_oneOffContextMenu.js]
 [browser_oneOffContextMenu_setDefault.js]
 [browser_oneOffHeader.js]
--- a/browser/components/search/test/browser_google.js
+++ b/browser/components/search/test/browser_google.js
@@ -2,88 +2,116 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /*
  * Test Google search plugin URLs
  */
 
 "use strict";
 
+let expectedEngine = {
+  name: "Google",
+  alias: null,
+  description: "Google Search",
+  searchForm: "https://www.google.com/search?q=&ie=utf-8&oe=utf-8",
+  hidden: false,
+  wrappedJSObject: {
+    queryCharset: "UTF-8",
+    "_iconURL": "data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///zD9/f2W/f392P39/fn9/f35/f391/39/ZT+/v4uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+Cf39/Zn///////////////////////////////////////////39/ZX///8IAAAAAAAAAAAAAAAA/v7+Cf39/cH/////+v35/7TZp/92ul3/WKs6/1iqOv9yuFn/rNWd//j79v///////f39v////wgAAAAAAAAAAP39/Zn/////7PXp/3G3WP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP+Or1j//vDo///////9/f2VAAAAAP///zD/////+vz5/3G3V/9TqDT/WKo6/6LQkf/U6cz/1urO/6rUm/+Zo0r/8IZB//adZ////v7///////7+/i79/f2Y/////4nWzf9Lqkj/Vqo4/9Xqzv///////////////////////ebY//SHRv/0hUL//NjD///////9/f2U/f392v////8sxPH/Ebzt/43RsP/////////////////////////////////4roL/9IVC//i1jf///////f391/39/fr/////Cr37/wW8+/+16/7/////////////////9IVC//SFQv/0hUL/9IVC//SFQv/3pnX///////39/fn9/f36/////wu++/8FvPv/tuz+//////////////////SFQv/0hUL/9IVC//SFQv/0hUL/96p7///////9/f35/f392/////81yfz/CrL5/2uk9v///////////////////////////////////////////////////////f392P39/Zn/////ks/7/zdS7P84Rur/0NT6///////////////////////9/f////////////////////////39/Zb+/v4y//////n5/v9WYu3/NUPq/ztJ6/+VnPT/z9L6/9HU+v+WnfT/Ul7t/+Hj/P////////////////////8wAAAAAP39/Z3/////6Or9/1hj7v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v9sdvD////////////9/f2YAAAAAAAAAAD///8K/f39w//////5+f7/paz2/11p7v88Suv/Okfq/1pm7v+iqfX/+fn+///////9/f3B/v7+CQAAAAAAAAAAAAAAAP///wr9/f2d///////////////////////////////////////////9/f2Z/v7+CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/jL9/f2Z/f392/39/fr9/f36/f392v39/Zj///8wAAAAAAAAAAAAAAAAAAAAAPAPAADAAwAAgAEAAIABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAACAAQAAwAMAAPAPAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/g3+/v5X/f39mf39/cj9/f3q/f39+f39/fn9/f3q/f39yP39/Zn+/v5W////DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/iT9/f2c/f399f/////////////////////////////////////////////////////9/f31/f39mv7+/iMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/gn9/f2K/f39+////////////////////////////////////////////////////////////////////////////f39+v39/Yf///8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v4k/f390v////////////////////////////////////////////////////////////////////////////////////////////////39/dD///8iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////MP39/er//////////////////////////+r05v+v16H/gsBs/2WxSf9Wqjj/Vqk3/2OwRv99vWX/pdKV/97u2P////////////////////////////39/ej+/v4vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/iT9/f3q/////////////////////+v15/+Pxnv/VKk2/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/36+Z//d7tf///////////////////////39/ej///8iAAAAAAAAAAAAAAAAAAAAAAAAAAD///8K/f390//////////////////////E4bn/XKw+/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1apN/+x0pv///////////////////////39/dD///8IAAAAAAAAAAAAAAAAAAAAAP39/Yv/////////////////////sdij/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/YKU1/8qOPv/5wZ////////////////////////39/YcAAAAAAAAAAAAAAAD+/v4l/f39+////////////////8Lgt/9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9utlT/n86N/7faqv+426v/pdKV/3u8ZP9UqDX/U6g0/3egN//jiUH/9IVC//SFQv/82MP//////////////////f39+v7+/iMAAAAAAAAAAP39/Z3////////////////q9Ob/W6w+/1OoNP9TqDT/U6g0/1OoNP9nskz/zOXC/////////////////////////////////+Dv2v+osWP/8YVC//SFQv/0hUL/9IVC//WQVP/++fb//////////////////f39mgAAAAD+/v4O/f399v///////////////4LHj/9TqDT/U6g0/1OoNP9TqDT/dblc//L58P/////////////////////////////////////////////8+v/3p3f/9IVC//SFQv/0hUL/9IVC//rIqf/////////////////9/f31////DP7+/ln////////////////f9v7/Cbz2/zOwhv9TqDT/U6g0/2KwRv/v9+z///////////////////////////////////////////////////////738//1kFT/9IVC//SFQv/0hUL/9plg///////////////////////+/v5W/f39nP///////////////4jf/f8FvPv/Bbz7/yG1s/9QqDz/vN2w//////////////////////////////////////////////////////////////////rHqP/0hUL/9IVC//SFQv/0hUL//vDn//////////////////39/Zn9/f3L////////////////R878/wW8+/8FvPv/Bbz7/y7C5P/7/fr//////////////////////////////////////////////////////////////////ere//SFQv/0hUL/9IVC//SFQv/718H//////////////////f39yP39/ez///////////////8cwvv/Bbz7/wW8+/8FvPv/WNL8///////////////////////////////////////0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//rIqv/////////////////9/f3q/f39+v///////////////we9+/8FvPv/Bbz7/wW8+/993P3///////////////////////////////////////SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/+cGf//////////////////39/fn9/f36////////////////B737/wW8+/8FvPv/Bbz7/33c/f//////////////////////////////////////9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/6xaX//////////////////f39+f39/e3///////////////8cwvv/Bbz7/wW8+/8FvPv/WdP8///////////////////////////////////////0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//vVv//////////////////9/f3q/f39y////////////////0bN/P8FvPv/Bbz7/wW8+/8hrvn/+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////39/cj9/f2c////////////////ht/9/wW8+/8FvPv/FZP1/zRJ6/+zuPf//////////////////////////////////////////////////////////////////////////////////////////////////////////////////f39mf7+/lr////////////////d9v7/B7n7/yB38f81Q+r/NUPq/0hV7P/u8P3////////////////////////////////////////////////////////////////////////////////////////////////////////////+/v5X////D/39/ff///////////////9tkPT/NUPq/zVD6v81Q+r/NUPq/2Fs7//y8v7////////////////////////////////////////////09f7//////////////////////////////////////////////////f399f7+/g0AAAAA/f39n////////////////+Tm/P89Suv/NUPq/zVD6v81Q+r/NUPq/1Bc7f/IzPn/////////////////////////////////x8v5/0xY7P+MlPP////////////////////////////////////////////9/f2cAAAAAAAAAAD+/v4n/f39/P///////////////7W69/81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v9ZZe7/k5v0/6609/+vtff/lJv0/1pm7v81Q+r/NUPq/zVD6v+GjvL//v7//////////////////////////////f39+/7+/iQAAAAAAAAAAAAAAAD9/f2N/////////////////////6Cn9f81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v+BivL////////////////////////////9/f2KAAAAAAAAAAAAAAAAAAAAAP7+/gv9/f3V/////////////////////7W69/8+S+v/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/P0zr/7q/+P///////////////////////f390v7+/gkAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/ib9/f3r/////////////////////+Xn/P94gfH/NkTq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NkTq/3Z/8f/l5/z///////////////////////39/er+/v4kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/jL9/f3r///////////////////////////k5vz/nqX1/2p08P9IVez/OEbq/zdF6v9GU+z/aHLv/5qh9f/i5Pz////////////////////////////9/f3q////MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/ib9/f3V/////////////////////////////////////////////////////////////////////////////////////////////////f390v7+/iQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wr9/f2N/f39/P///////////////////////////////////////////////////////////////////////////f39+/39/Yv+/v4JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v4n/f39n/39/ff//////////////////////////////////////////////////////f399v39/Z3+/v4lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+Dv7+/lr9/f2c/f39y/39/e39/f36/f39+v39/ez9/f3L/f39nP7+/ln+/v4OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AA///AAD//AAAP/gAAB/wAAAP4AAAB8AAAAPAAAADgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAABgAAAAcAAAAPAAAAD4AAAB/AAAA/4AAAf/AAAP/8AAP//wAP/",
+    _urls: [
+      {
+        type: "application/x-suggestions+json",
+        method: "GET",
+        template: "https://www.google.com/complete/search?client=firefox&q={searchTerms}",
+        params: "",
+      },
+      {
+        type: "text/html",
+        method: "GET",
+        template: "https://www.google.com/search",
+        params: [
+          {
+            "name": "q",
+            "value": "{searchTerms}",
+            "purpose": undefined,
+          },
+          {
+            "name": "ie",
+            "value": "utf-8",
+            "purpose": undefined,
+          },
+          {
+            "name": "oe",
+            "value": "utf-8",
+            "purpose": undefined,
+          },
+        ],
+        mozparams: {
+        },
+      },
+    ],
+  },
+};
+
 function test() {
   let engine = Services.search.getEngineByName("Google");
-  ok(engine, "Google");
+  ok(engine, "Found Google search engine");
+
+  let countryCode = Services.prefs.getCharPref("browser.search.countryCode");
+  let code = "";
+  switch (countryCode) {
+    case "US":
+      code = "firefox-b-1";
+      break;
+    case "DE":
+      code = "firefox-b";
+      break;
+    case "RU":
+      // Covered by test but doesn't use a code
+      break;
+  }
 
   let base = "https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8";
+  // Keyword uses a slightly different code
+  let keywordBase = base;
+  if (code) {
+    let suffix = `&client=${code}`;
+    base += suffix;
+    keywordBase += `${suffix}-ab`;
+    expectedEngine.searchForm += suffix;
+    let urlParams = expectedEngine.wrappedJSObject._urls[1].params;
+    urlParams.push({
+      name: "client",
+      value: `${code}-ab`,
+      purpose: "keyword",
+    });
+    urlParams.push({
+      name: "client",
+      value: code,
+      purpose: "searchbar",
+    });
+  }
 
   let url;
 
   // Test search URLs (including purposes).
-  url = engine.getSubmission("foo").uri.spec;
-  is(url, base, "Check search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
-  is(url, base, "Check context menu search URL for 'foo'");
+  let purposes = ["", "contextmenu", "searchbar", "homepage", "newtab"];
+  for (let purpose of purposes) {
+    url = engine.getSubmission("foo", null, purpose).uri.spec;
+    is(url, base, `Check ${purpose} search URL for 'foo'`);
+  }
   url = engine.getSubmission("foo", null, "keyword").uri.spec;
-  is(url, base, "Check keyword search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "searchbar").uri.spec;
-  is(url, base, "Check search bar search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "homepage").uri.spec;
-  is(url, base, "Check homepage search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "newtab").uri.spec;
-  is(url, base, "Check newtab search URL for 'foo'");
+  is(url, keywordBase, "Check keyword search URL for 'foo'");
 
   // Check search suggestion URL.
   url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;
   is(url, "https://www.google.com/complete/search?client=firefox&q=foo", "Check search suggestion URL for 'foo'");
 
   // Check result parsing and alternate domains.
   let alternateBase = base.replace("www.google.com", "www.google.fr");
   is(Services.search.parseSubmissionURL(base).terms, "foo",
      "Check result parsing");
   is(Services.search.parseSubmissionURL(alternateBase).terms, "foo",
      "Check alternate domain");
 
   // Check all other engine properties.
-  const EXPECTED_ENGINE = {
-    name: "Google",
-    alias: null,
-    description: "Google Search",
-    searchForm: "https://www.google.com/search?q=&ie=utf-8&oe=utf-8",
-    hidden: false,
-    wrappedJSObject: {
-      queryCharset: "UTF-8",
-      "_iconURL": "data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///zD9/f2W/f392P39/fn9/f35/f391/39/ZT+/v4uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+Cf39/Zn///////////////////////////////////////////39/ZX///8IAAAAAAAAAAAAAAAA/v7+Cf39/cH/////+v35/7TZp/92ul3/WKs6/1iqOv9yuFn/rNWd//j79v///////f39v////wgAAAAAAAAAAP39/Zn/////7PXp/3G3WP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP+Or1j//vDo///////9/f2VAAAAAP///zD/////+vz5/3G3V/9TqDT/WKo6/6LQkf/U6cz/1urO/6rUm/+Zo0r/8IZB//adZ////v7///////7+/i79/f2Y/////4nWzf9Lqkj/Vqo4/9Xqzv///////////////////////ebY//SHRv/0hUL//NjD///////9/f2U/f392v////8sxPH/Ebzt/43RsP/////////////////////////////////4roL/9IVC//i1jf///////f391/39/fr/////Cr37/wW8+/+16/7/////////////////9IVC//SFQv/0hUL/9IVC//SFQv/3pnX///////39/fn9/f36/////wu++/8FvPv/tuz+//////////////////SFQv/0hUL/9IVC//SFQv/0hUL/96p7///////9/f35/f392/////81yfz/CrL5/2uk9v///////////////////////////////////////////////////////f392P39/Zn/////ks/7/zdS7P84Rur/0NT6///////////////////////9/f////////////////////////39/Zb+/v4y//////n5/v9WYu3/NUPq/ztJ6/+VnPT/z9L6/9HU+v+WnfT/Ul7t/+Hj/P////////////////////8wAAAAAP39/Z3/////6Or9/1hj7v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v9sdvD////////////9/f2YAAAAAAAAAAD///8K/f39w//////5+f7/paz2/11p7v88Suv/Okfq/1pm7v+iqfX/+fn+///////9/f3B/v7+CQAAAAAAAAAAAAAAAP///wr9/f2d///////////////////////////////////////////9/f2Z/v7+CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/jL9/f2Z/f392/39/fr9/f36/f392v39/Zj///8wAAAAAAAAAAAAAAAAAAAAAPAPAADAAwAAgAEAAIABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAACAAQAAwAMAAPAPAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/g3+/v5X/f39mf39/cj9/f3q/f39+f39/fn9/f3q/f39yP39/Zn+/v5W////DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/iT9/f2c/f399f/////////////////////////////////////////////////////9/f31/f39mv7+/iMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/gn9/f2K/f39+////////////////////////////////////////////////////////////////////////////f39+v39/Yf///8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v4k/f390v////////////////////////////////////////////////////////////////////////////////////////////////39/dD///8iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////MP39/er//////////////////////////+r05v+v16H/gsBs/2WxSf9Wqjj/Vqk3/2OwRv99vWX/pdKV/97u2P////////////////////////////39/ej+/v4vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/iT9/f3q/////////////////////+v15/+Pxnv/VKk2/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/36+Z//d7tf///////////////////////39/ej///8iAAAAAAAAAAAAAAAAAAAAAAAAAAD///8K/f390//////////////////////E4bn/XKw+/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1apN/+x0pv///////////////////////39/dD///8IAAAAAAAAAAAAAAAAAAAAAP39/Yv/////////////////////sdij/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9TqDT/YKU1/8qOPv/5wZ////////////////////////39/YcAAAAAAAAAAAAAAAD+/v4l/f39+////////////////8Lgt/9TqDT/U6g0/1OoNP9TqDT/U6g0/1OoNP9utlT/n86N/7faqv+426v/pdKV/3u8ZP9UqDX/U6g0/3egN//jiUH/9IVC//SFQv/82MP//////////////////f39+v7+/iMAAAAAAAAAAP39/Z3////////////////q9Ob/W6w+/1OoNP9TqDT/U6g0/1OoNP9nskz/zOXC/////////////////////////////////+Dv2v+osWP/8YVC//SFQv/0hUL/9IVC//WQVP/++fb//////////////////f39mgAAAAD+/v4O/f399v///////////////4LHj/9TqDT/U6g0/1OoNP9TqDT/dblc//L58P/////////////////////////////////////////////8+v/3p3f/9IVC//SFQv/0hUL/9IVC//rIqf/////////////////9/f31////DP7+/ln////////////////f9v7/Cbz2/zOwhv9TqDT/U6g0/2KwRv/v9+z///////////////////////////////////////////////////////738//1kFT/9IVC//SFQv/0hUL/9plg///////////////////////+/v5W/f39nP///////////////4jf/f8FvPv/Bbz7/yG1s/9QqDz/vN2w//////////////////////////////////////////////////////////////////rHqP/0hUL/9IVC//SFQv/0hUL//vDn//////////////////39/Zn9/f3L////////////////R878/wW8+/8FvPv/Bbz7/y7C5P/7/fr//////////////////////////////////////////////////////////////////ere//SFQv/0hUL/9IVC//SFQv/718H//////////////////f39yP39/ez///////////////8cwvv/Bbz7/wW8+/8FvPv/WNL8///////////////////////////////////////0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//rIqv/////////////////9/f3q/f39+v///////////////we9+/8FvPv/Bbz7/wW8+/993P3///////////////////////////////////////SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/+cGf//////////////////39/fn9/f36////////////////B737/wW8+/8FvPv/Bbz7/33c/f//////////////////////////////////////9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/6xaX//////////////////f39+f39/e3///////////////8cwvv/Bbz7/wW8+/8FvPv/WdP8///////////////////////////////////////0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//vVv//////////////////9/f3q/f39y////////////////0bN/P8FvPv/Bbz7/wW8+/8hrvn/+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////39/cj9/f2c////////////////ht/9/wW8+/8FvPv/FZP1/zRJ6/+zuPf//////////////////////////////////////////////////////////////////////////////////////////////////////////////////f39mf7+/lr////////////////d9v7/B7n7/yB38f81Q+r/NUPq/0hV7P/u8P3////////////////////////////////////////////////////////////////////////////////////////////////////////////+/v5X////D/39/ff///////////////9tkPT/NUPq/zVD6v81Q+r/NUPq/2Fs7//y8v7////////////////////////////////////////////09f7//////////////////////////////////////////////////f399f7+/g0AAAAA/f39n////////////////+Tm/P89Suv/NUPq/zVD6v81Q+r/NUPq/1Bc7f/IzPn/////////////////////////////////x8v5/0xY7P+MlPP////////////////////////////////////////////9/f2cAAAAAAAAAAD+/v4n/f39/P///////////////7W69/81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v9ZZe7/k5v0/6609/+vtff/lJv0/1pm7v81Q+r/NUPq/zVD6v+GjvL//v7//////////////////////////////f39+/7+/iQAAAAAAAAAAAAAAAD9/f2N/////////////////////6Cn9f81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v+BivL////////////////////////////9/f2KAAAAAAAAAAAAAAAAAAAAAP7+/gv9/f3V/////////////////////7W69/8+S+v/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/P0zr/7q/+P///////////////////////f390v7+/gkAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/ib9/f3r/////////////////////+Xn/P94gfH/NkTq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NUPq/zVD6v81Q+r/NkTq/3Z/8f/l5/z///////////////////////39/er+/v4kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/jL9/f3r///////////////////////////k5vz/nqX1/2p08P9IVez/OEbq/zdF6v9GU+z/aHLv/5qh9f/i5Pz////////////////////////////9/f3q////MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+/ib9/f3V/////////////////////////////////////////////////////////////////////////////////////////////////f390v7+/iQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wr9/f2N/f39/P///////////////////////////////////////////////////////////////////////////f39+/39/Yv+/v4JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v4n/f39n/39/ff//////////////////////////////////////////////////////f399v39/Z3+/v4lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+Dv7+/lr9/f2c/f39y/39/e39/f36/f39+v39/ez9/f3L/f39nP7+/ln+/v4OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AA///AAD//AAAP/gAAB/wAAAP4AAAB8AAAAPAAAADgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAABgAAAAcAAAAPAAAAD4AAAB/AAAA/4AAAf/AAAP/8AAP//wAP/",
-      _urls: [
-        {
-          type: "application/x-suggestions+json",
-          method: "GET",
-          template: "https://www.google.com/complete/search?client=firefox&q={searchTerms}",
-          params: "",
-        },
-        {
-          type: "text/html",
-          method: "GET",
-          template: "https://www.google.com/search",
-          params: [
-            {
-              "name": "q",
-              "value": "{searchTerms}",
-              "purpose": undefined,
-            },
-            {
-              "name": "ie",
-              "value": "utf-8",
-              "purpose": undefined,
-            },
-            {
-              "name": "oe",
-              "value": "utf-8",
-              "purpose": undefined,
-            },
-          ],
-          mozparams: {
-          },
-        },
-      ],
-    },
-  };
-
-  isSubObjectOf(EXPECTED_ENGINE, engine, "Google");
+  isSubObjectOf(expectedEngine, engine, "Google");
 }
--- a/browser/components/search/test/browser_google_behavior.js
+++ b/browser/components/search/test/browser_google_behavior.js
@@ -4,28 +4,51 @@
 /*
  * Test Google search plugin URLs
  * TODO: This test is a near duplicate of browser_searchEngine_behaviors.js but
  * specific to Google. This is required due to bug 1315953.
  */
 
 "use strict";
 
-const SEARCH_ENGINE_DETAILS = [{
+let searchEngineDetails = [{
   alias: "g",
   baseURL: "https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8",
   codes: {
     context: "",
     keyword: "",
     newTab: "",
     submission: "",
   },
   name: "Google",
 }];
 
+let countryCode = Services.prefs.getCharPref("browser.search.countryCode");
+let code = "";
+switch (countryCode) {
+  case "US":
+    code = "firefox-b-1";
+    break;
+  case "DE":
+    code = "firefox-b";
+    break;
+  case "RU":
+    // Covered by test but doesn't use a code
+    break;
+}
+
+if (code) {
+  let codes = searchEngineDetails[0].codes;
+  let suffix = `&client=${code}`;
+  codes.context = suffix;
+  codes.newTab = suffix;
+  codes.submission = suffix;
+  codes.keyword = `${suffix}-ab`;
+}
+
 function promiseStateChangeURI() {
   return new Promise(resolve => {
     let listener = {
       onStateChange: function onStateChange(webProgress, req, flags, status) {
         info("onStateChange");
         // Only care about top-level document starts
         let docStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
                        Ci.nsIWebProgressListener.STATE_START;
@@ -69,17 +92,17 @@ function promiseContentSearchReady(brows
           content.removeEventListener("ContentSearchService", listener);
           resolve();
         }
       });
     });
   });
 }
 
-for (let engine of SEARCH_ENGINE_DETAILS) {
+for (let engine of searchEngineDetails) {
   add_task(async function() {
     let previouslySelectedEngine = Services.search.currentEngine;
 
     registerCleanupFunction(function() {
       Services.search.currentEngine = previouslySelectedEngine;
     });
 
     await testSearchEngine(engine);
deleted file mode 100644
--- a/browser/components/search/test/browser_google_codes.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const kUrlPref = "geoSpecificDefaults.url";
-const BROWSER_SEARCH_PREF = "browser.search.";
-
-var originalGeoURL;
-var originalCountryCode;
-var originalRegion;
-
-/**
- * Clean the profile of any cache file left from a previous run.
- * Returns a boolean indicating if the cache file existed.
- */
-function removeCacheFile() {
-  const CACHE_FILENAME = "search.json.mozlz4";
-
-  let file =  Services.dirsvc.get("ProfD", Ci.nsIFile);
-  file.append(CACHE_FILENAME);
-  if (file.exists()) {
-    file.remove(false);
-    return true;
-  }
-  return false;
-}
-
-/**
- * Returns a promise that is resolved when an observer notification from the
- * search service fires with the specified data.
- *
- * @param aExpectedData
- *        The value the observer notification sends that causes us to resolve
- *        the promise.
- */
-function waitForSearchNotification(aExpectedData, aCallback) {
-  const SEARCH_SERVICE_TOPIC = "browser-search-service";
-  Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-    if (aData != aExpectedData)
-      return;
-
-    Services.obs.removeObserver(observer, SEARCH_SERVICE_TOPIC);
-    aCallback();
-  }, SEARCH_SERVICE_TOPIC);
-}
-
-function asyncInit() {
-  return new Promise(resolve => {
-    Services.search.init(function() {
-      ok(Services.search.isInitialized, "search service should be initialized");
-      resolve();
-    });
-  });
-}
-
-function asyncReInit() {
-  let promise = new Promise(resolve => {
-    waitForSearchNotification("reinit-complete", resolve);
-  });
-
-  Services.search.QueryInterface(Ci.nsIObserver)
-          .observe(null, "intl:requested-locales-changed", null);
-
-  return promise;
-}
-
-let gEngineCount;
-
-add_task(async function preparation() {
-  // ContentSearch is interferring with our async re-initializations of the
-  // search service: once _initServicePromise has resolved, it will access
-  // the search service, thus causing unpredictable behavior due to
-  // synchronous initializations of the service.
-  let originalContentSearchPromise = ContentSearch._initServicePromise;
-  ContentSearch._initServicePromise = new Promise(resolve => {
-    registerCleanupFunction(() => {
-      ContentSearch._initServicePromise = originalContentSearchPromise;
-      resolve();
-    });
-  });
-
-  await asyncInit();
-  gEngineCount = Services.search.getVisibleEngines().length;
-
-  waitForSearchNotification("uninit-complete", () => {
-    // Verify search service is not initialized
-    is(Services.search.isInitialized, false, "Search service should NOT be initialized");
-
-    removeCacheFile();
-
-    // Make sure we get the new country/region values, but save the old
-    originalCountryCode = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "countryCode");
-    originalRegion = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "region");
-    Services.prefs.clearUserPref(BROWSER_SEARCH_PREF + "countryCode");
-    Services.prefs.clearUserPref(BROWSER_SEARCH_PREF + "region");
-
-    // Geo specific defaults won't be fetched if there's no country code.
-    Services.prefs.setCharPref("browser.search.geoip.url",
-                               'data:application/json,{"country_code": "DE"}');
-
-    Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", true);
-
-    // Avoid going to the server for the geo lookup. We take the defaults
-    originalGeoURL = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + kUrlPref);
-    let geoUrl = "data:application/json,{}";
-    Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF).setCharPref(kUrlPref, geoUrl);
-  });
-
-  await asyncReInit();
-
-  await new Promise(resolve => {
-    waitForSearchNotification("write-cache-to-disk-complete", resolve);
-  });
-});
-
-add_task(async function tests() {
-  let engine = Services.search.getEngineByName("Google");
-  ok(engine, "Google");
-
-  let base = "https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8&client=firefox-b";
-
-  // Keyword uses a slightly different code
-  let keywordBase = base + "-ab";
-
-  let url;
-
-  // Test search URLs (including purposes).
-  url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
-  is(url, base, "Check context menu search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "keyword").uri.spec;
-  is(url, keywordBase, "Check keyword search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "searchbar").uri.spec;
-  is(url, base, "Check search bar search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "homepage").uri.spec;
-  is(url, base, "Check homepage search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "newtab").uri.spec;
-  is(url, base, "Check newtab search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "system").uri.spec;
-  is(url, base, "Check system search URL for 'foo'");
-});
-
-
-add_task(async function cleanup() {
-  waitForSearchNotification("uninit-complete", () => {
-    // Verify search service is not initialized
-    is(Services.search.isInitialized, false,
-       "Search service should NOT be initialized");
-    removeCacheFile();
-
-    Services.prefs.clearUserPref("browser.search.geoip.url");
-
-    Services.prefs.setCharPref(BROWSER_SEARCH_PREF + "countryCode", originalCountryCode);
-    Services.prefs.setCharPref(BROWSER_SEARCH_PREF + "region", originalRegion);
-
-    // We can't clear the pref because it's set to false by testing/profiles/prefs_general.js
-    Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", false);
-
-    Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF).setCharPref(kUrlPref, originalGeoURL);
-  });
-
-  await asyncReInit();
-  is(gEngineCount, Services.search.getVisibleEngines().length,
-     "correct engine count after cleanup");
-});
deleted file mode 100644
--- a/browser/components/search/test/browser_google_nocodes.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const kUrlPref = "geoSpecificDefaults.url";
-const BROWSER_SEARCH_PREF = "browser.search.";
-
-var originalGeoURL;
-var originalCountryCode;
-var originalRegion;
-
-/**
- * Clean the profile of any cache file left from a previous run.
- * Returns a boolean indicating if the cache file existed.
- */
-function removeCacheFile() {
-  const CACHE_FILENAME = "search.json.mozlz4";
-
-  let file =  Services.dirsvc.get("ProfD", Ci.nsIFile);
-  file.append(CACHE_FILENAME);
-  if (file.exists()) {
-    file.remove(false);
-    return true;
-  }
-  return false;
-}
-
-/**
- * Returns a promise that is resolved when an observer notification from the
- * search service fires with the specified data.
- *
- * @param aExpectedData
- *        The value the observer notification sends that causes us to resolve
- *        the promise.
- */
-function waitForSearchNotification(aExpectedData, aCallback) {
-  const SEARCH_SERVICE_TOPIC = "browser-search-service";
-  Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-    if (aData != aExpectedData)
-      return;
-
-    Services.obs.removeObserver(observer, SEARCH_SERVICE_TOPIC);
-    aCallback();
-  }, SEARCH_SERVICE_TOPIC);
-}
-
-function asyncInit() {
-  return new Promise(resolve => {
-    Services.search.init(function() {
-      ok(Services.search.isInitialized, "search service should be initialized");
-      resolve();
-    });
-  });
-}
-
-function asyncReInit() {
-  let promise = new Promise(resolve => {
-    waitForSearchNotification("reinit-complete", resolve);
-  });
-
-  Services.search.QueryInterface(Ci.nsIObserver)
-          .observe(null, "intl:requested-locales-changed", null);
-
-  return promise;
-}
-
-let gEngineCount;
-
-add_task(async function preparation() {
-  // ContentSearch is interferring with our async re-initializations of the
-  // search service: once _initServicePromise has resolved, it will access
-  // the search service, thus causing unpredictable behavior due to
-  // synchronous initializations of the service.
-  let originalContentSearchPromise = ContentSearch._initServicePromise;
-  ContentSearch._initServicePromise = new Promise(resolve => {
-    registerCleanupFunction(() => {
-      ContentSearch._initServicePromise = originalContentSearchPromise;
-      resolve();
-    });
-  });
-
-  await asyncInit();
-  gEngineCount = Services.search.getVisibleEngines().length;
-
-  waitForSearchNotification("uninit-complete", () => {
-    // Verify search service is not initialized
-    is(Services.search.isInitialized, false, "Search service should NOT be initialized");
-
-    removeCacheFile();
-
-    // Make sure we get the new country/region values, but save the old
-    originalCountryCode = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "countryCode");
-    originalRegion = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "region");
-    Services.prefs.clearUserPref(BROWSER_SEARCH_PREF + "countryCode");
-    Services.prefs.clearUserPref(BROWSER_SEARCH_PREF + "region");
-
-    // Geo specific defaults won't be fetched if there's no country code.
-    Services.prefs.setCharPref("browser.search.geoip.url",
-                               'data:application/json,{"country_code": "US"}');
-
-    Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", true);
-
-    // Avoid going to the server for the geo lookup. We take the defaults
-    originalGeoURL = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + kUrlPref);
-    let geoUrl = "data:application/json,{}";
-    Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF).setCharPref(kUrlPref, geoUrl);
-  });
-
-  await asyncReInit();
-
-  await new Promise(resolve => {
-    waitForSearchNotification("write-cache-to-disk-complete", resolve);
-  });
-});
-
-add_task(async function tests() {
-  let engine = Services.search.getEngineByName("Google");
-  ok(engine, "Google");
-
-  let base = "https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8";
-
-  let url;
-
-  // Test search URLs (including purposes).
-  url = engine.getSubmission("foo", null, "contextmenu").uri.spec;
-  is(url, base, "Check context menu search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "keyword").uri.spec;
-  is(url, base, "Check keyword search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "searchbar").uri.spec;
-  is(url, base, "Check search bar search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "homepage").uri.spec;
-  is(url, base, "Check homepage search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "newtab").uri.spec;
-  is(url, base, "Check newtab search URL for 'foo'");
-  url = engine.getSubmission("foo", null, "system").uri.spec;
-  is(url, base, "Check system search URL for 'foo'");
-});
-
-
-add_task(async function cleanup() {
-  waitForSearchNotification("uninit-complete", () => {
-    // Verify search service is not initialized
-    is(Services.search.isInitialized, false,
-       "Search service should NOT be initialized");
-    removeCacheFile();
-
-    Services.prefs.clearUserPref("browser.search.geoip.url");
-
-    Services.prefs.setCharPref(BROWSER_SEARCH_PREF + "countryCode", originalCountryCode);
-    Services.prefs.setCharPref(BROWSER_SEARCH_PREF + "region", originalRegion);
-
-    // We can't clear the pref because it's set to false by testing/profiles/prefs_general.js
-    Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", false);
-
-    Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF).setCharPref(kUrlPref, originalGeoURL);
-  });
-
-  await asyncReInit();
-  is(gEngineCount, Services.search.getVisibleEngines().length,
-     "correct engine count after cleanup");
-});
new file mode 100644
--- /dev/null
+++ b/browser/components/search/test/google_codes/browser.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+prefs =
+  browser.search.countryCode='DE'
+
+[../browser_google.js]
+skip-if = artifact # bug 1315953
+[../browser_google_behavior.js]
+skip-if = artifact # bug 1315953
new file mode 100644
--- /dev/null
+++ b/browser/components/search/test/google_nocodes/browser.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+prefs =
+  browser.search.countryCode='RU'
+
+[../browser_google.js]
+skip-if = artifact # bug 1315953
+[../browser_google_behavior.js]
+skip-if = artifact # bug 1315953
--- a/browser/locales/search/list.json
+++ b/browser/locales/search/list.json
@@ -1,20 +1,19 @@
 {
   "default": {
     "visibleDefaultEngines": [
       "google", "yahoo", "amazondotcom", "bing", "ddg", "ebay", "twitter", "wikipedia"
     ]
   },
   "regionOverrides": {
     "US": {
-      "google": "google-nocodes"
+      "google": "google-2018"
     },
     "CA": {
-      "google": "google-nocodes",
       "ebay": "ebay-ca",
       "ebay-fr": "ebay-ca"
     },
     "KZ": {
       "google": "google-nocodes"
     },
     "BY": {
       "google": "google-nocodes"
@@ -23,22 +22,16 @@
       "google": "google-nocodes"
     },
     "TR": {
       "google": "google-nocodes"
     },
     "CN": {
       "google": "google-nocodes"
     },
-    "TW": {
-      "google": "google-nocodes"
-    },
-    "HK": {
-      "google": "google-nocodes"
-    },
     "AT": {
       "ebay-de": "ebay-at"
     },
     "AU": {
       "ebay": "ebay-au",
       "ebay-uk": "ebay-au"
     },
     "BE": {
--- a/mobile/locales/en-US/chrome/region.properties
+++ b/mobile/locales/en-US/chrome/region.properties
@@ -7,19 +7,19 @@ browser.search.defaultenginename=Google
 
 # Search engine order (order displayed in the search bar dropdown).
 browser.search.order.1=Google
 browser.search.order.2=Yahoo
 browser.search.order.3=Bing
 
 # These override the equivalents above when the client detects that it is in
 # US market only.
-browser.search.defaultenginename.US=Yahoo
-browser.search.order.US.1=Yahoo
-browser.search.order.US.2=Google
+browser.search.defaultenginename.US=Google
+browser.search.order.US.1=Google
+browser.search.order.US.2=Yahoo
 browser.search.order.US.3=Bing
 
 # increment this number when anything gets changed in the list below.  This will
 # cause Firefox to re-read these prefs and inject any new handlers into the
 # profile database.  Note that "new" is defined as "has a different URL"; this
 # means that it's not possible to update the name of existing handler, so
 # don't make any spelling errors here.
 gecko.handlerService.defaultHandlersVersion=3
--- a/mobile/locales/search/list.json
+++ b/mobile/locales/search/list.json
@@ -1,20 +1,17 @@
 {
   "default": {
     "visibleDefaultEngines": [
       "google", "yahoo", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
     ]
   },
   "regionOverrides": {
     "US": {
-      "google": "google-nocodes"
-    },
-    "CA": {
-      "google": "google-nocodes"
+      "google": "google-2018"
     },
     "KZ": {
       "google": "google-nocodes"
     },
     "BY": {
       "google": "google-nocodes"
     },
     "RU": {
@@ -23,22 +20,16 @@
     "TR": {
       "google": "google-nocodes"
     },
     "UA": {
       "google": "google-nocodes"
     },
     "CN": {
       "google": "google-nocodes"
-    },
-    "TW": {
-      "google": "google-nocodes"
-    },
-    "HK": {
-      "google": "google-nocodes"
     }
   },
   "locales": {
     "ach": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "wikipedia"
         ]