summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 07:35:42 +0000
committermichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 07:35:42 +0000
commit7e1a56582fbf79377a28adf137f5bf9db62e2274 (patch)
treeb2e6882e662cfc3e82d86472204f4b6fba3c7cf0
parent81d8a0cf3965baa53329ea68c944aa50c923a4c7 (diff)
downloadchromium_src-7e1a56582fbf79377a28adf137f5bf9db62e2274.zip
chromium_src-7e1a56582fbf79377a28adf137f5bf9db62e2274.tar.gz
chromium_src-7e1a56582fbf79377a28adf137f5bf9db62e2274.tar.bz2
Fix TemplateURLFetcherTest.* for Android.
BUG=139427 Review URL: https://chromiumcodereview.appspot.com/11348135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169001 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/android/gtest_filter/unit_tests_disabled3
-rw-r--r--chrome/browser/search_engines/template_url_prepopulate_data.cc28
2 files changed, 11 insertions, 20 deletions
diff --git a/build/android/gtest_filter/unit_tests_disabled b/build/android/gtest_filter/unit_tests_disabled
index d8206af..33e67e0 100644
--- a/build/android/gtest_filter/unit_tests_disabled
+++ b/build/android/gtest_filter/unit_tests_disabled
@@ -22,9 +22,6 @@ TemplateURLPrepopulateDataTest.*
TemplateURLServiceSyncTest.*
SearchHostToURLsMapTest.*
-# crbug.com/139427
-TemplateURLFetcherTest.*
-
# crbug.com/139433
AutofillTableTest.AutofillProfile*
AutofillTableTest.UpdateAutofillProfile
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc
index 71eaa3d..9e9e279 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc
@@ -526,7 +526,6 @@ const PrepopulatedEngine* kAllEngines[] =
// value we call the CountryID.
const int kCountryIDUnknown = -1;
-const int kCountryIDNotSet = 0;
inline int CountryCharsToCountryID(char c1, char c2) {
return c1 << 8 | c2;
@@ -635,13 +634,22 @@ int GetCurrentCountryID() {
#elif defined(OS_ANDROID)
// Initialized by InitCountryCode().
-int g_country_code_at_install = kCountryIDNotSet;
+int g_country_code_at_install = kCountryIDUnknown;
int GetCurrentCountryID() {
- DCHECK(g_country_code_at_install != kCountryIDNotSet);
return g_country_code_at_install;
}
+void InitCountryCode(const std::string& country_code) {
+ if (country_code.size() != 2) {
+ DLOG(ERROR) << "Invalid country code: " << country_code;
+ g_country_code_at_install = kCountryIDUnknown;
+ } else {
+ g_country_code_at_install =
+ CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]);
+ }
+}
+
#elif defined(OS_POSIX)
int GetCurrentCountryID() {
@@ -1279,18 +1287,4 @@ GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) {
return GURL();
}
-#if defined(OS_ANDROID)
-
-void InitCountryCode(const std::string& country_code) {
- if (country_code.size() != 2) {
- DLOG(ERROR) << "Invalid country code: " << country_code;
- g_country_code_at_install = kCountryIDUnknown;
- } else {
- g_country_code_at_install =
- CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]);
- }
-}
-
-#endif
-
} // namespace TemplateURLPrepopulateData