| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "chrome/browser/chromeos/base/locale_util.h" | 10 #include "chrome/browser/chromeos/base/locale_util.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 system::StatisticsProvider::SetTestProvider(statistics_provider_.get()); | 208 system::StatisticsProvider::SetTestProvider(statistics_provider_.get()); |
| 209 statistics_provider_->SetMachineStatistic("initial_locale", GetParam()); | 209 statistics_provider_->SetMachineStatistic("initial_locale", GetParam()); |
| 210 statistics_provider_->SetMachineStatistic("keyboard_layout", ""); | 210 statistics_provider_->SetMachineStatistic("keyboard_layout", ""); |
| 211 } | 211 } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 scoped_ptr<system::FakeStatisticsProvider> statistics_provider_; | 214 scoped_ptr<system::FakeStatisticsProvider> statistics_provider_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 IN_PROC_BROWSER_TEST_P(CustomizationVPDTest, GetUILanguageList) { | 217 IN_PROC_BROWSER_TEST_P(CustomizationVPDTest, GetUILanguageList) { |
| 218 std::vector<std::string> locales; | 218 std::vector<std::string> locales = base::SplitString( |
| 219 base::SplitString(GetParam(), ',', &locales); | 219 GetParam(), ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 220 | 220 |
| 221 for (std::string& l : locales) { | 221 for (std::string& l : locales) { |
| 222 base::TrimString(l, " ", &l); | 222 base::TrimString(l, " ", &l); |
| 223 } | 223 } |
| 224 EXPECT_EQ(locales, | 224 EXPECT_EQ(locales, |
| 225 StartupCustomizationDocument::GetInstance()->configured_locales()) | 225 StartupCustomizationDocument::GetInstance()->configured_locales()) |
| 226 << "Test failed for initial_locale='" << GetParam() | 226 << "Test failed for initial_locale='" << GetParam() |
| 227 << "', locales=" << Print(locales); | 227 << "', locales=" << Print(locales); |
| 228 | 228 |
| 229 scoped_ptr<base::ListValue> ui_language_list = GetUILanguageList(NULL, ""); | 229 scoped_ptr<base::ListValue> ui_language_list = GetUILanguageList(NULL, ""); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 248 break; | 248 break; |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 INSTANTIATE_TEST_CASE_P(StringSequence, | 253 INSTANTIATE_TEST_CASE_P(StringSequence, |
| 254 CustomizationVPDTest, | 254 CustomizationVPDTest, |
| 255 testing::ValuesIn(kVPDInitialLocales)); | 255 testing::ValuesIn(kVPDInitialLocales)); |
| 256 | 256 |
| 257 } // namespace chromeos | 257 } // namespace chromeos |
| OLD | NEW |