OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/preferences.h" | 5 #include "chrome/browser/chromeos/preferences.h" |
6 | 6 |
7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/prefs/pref_member.h" | 8 #include "base/prefs/pref_member.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // given the same address in the next test. | 186 // given the same address in the next test. |
187 UserSessionManager::GetInstance()->RemoveProfileForTesting(test_profile_); | 187 UserSessionManager::GetInstance()->RemoveProfileForTesting(test_profile_); |
188 } | 188 } |
189 | 189 |
190 void InitPreferences() { | 190 void InitPreferences() { |
191 prefs_->InitUserPrefsForTesting( | 191 prefs_->InitUserPrefsForTesting( |
192 pref_service_, test_user_, mock_manager_->GetActiveIMEState()); | 192 pref_service_, test_user_, mock_manager_->GetActiveIMEState()); |
193 prefs_->SetInputMethodListForTesting(); | 193 prefs_->SetInputMethodListForTesting(); |
194 } | 194 } |
195 | 195 |
| 196 content::TestBrowserThreadBundle thread_bundle_; |
196 scoped_ptr<TestingProfileManager> profile_manager_; | 197 scoped_ptr<TestingProfileManager> profile_manager_; |
197 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 198 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
198 scoped_ptr<Preferences> prefs_; | 199 scoped_ptr<Preferences> prefs_; |
199 StringPrefMember previous_input_method_; | 200 StringPrefMember previous_input_method_; |
200 StringPrefMember current_input_method_; | 201 StringPrefMember current_input_method_; |
201 | 202 |
202 // Not owned. | 203 // Not owned. |
203 const user_manager::User* test_user_; | 204 const user_manager::User* test_user_; |
204 TestingProfile* test_profile_; | 205 TestingProfile* test_profile_; |
205 TestingPrefServiceSyncable* pref_service_; | 206 TestingPrefServiceSyncable* pref_service_; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 &extension_ime_util::GetInputMethodIDByEngineID); | 346 &extension_ime_util::GetInputMethodIDByEngineID); |
346 return JoinString(tokens, ','); | 347 return JoinString(tokens, ','); |
347 } | 348 } |
348 | 349 |
349 StringPrefMember preferred_languages_; | 350 StringPrefMember preferred_languages_; |
350 StringPrefMember preferred_languages_syncable_; | 351 StringPrefMember preferred_languages_syncable_; |
351 StringPrefMember preload_engines_; | 352 StringPrefMember preload_engines_; |
352 StringPrefMember preload_engines_syncable_; | 353 StringPrefMember preload_engines_syncable_; |
353 StringPrefMember enabled_extension_imes_; | 354 StringPrefMember enabled_extension_imes_; |
354 StringPrefMember enabled_extension_imes_syncable_; | 355 StringPrefMember enabled_extension_imes_syncable_; |
355 content::TestBrowserThreadBundle thread_bundle_; | |
356 | 356 |
357 private: | 357 private: |
358 DISALLOW_COPY_AND_ASSIGN(InputMethodPreferencesTest); | 358 DISALLOW_COPY_AND_ASSIGN(InputMethodPreferencesTest); |
359 }; | 359 }; |
360 | 360 |
361 // Tests that the server values are added to the values chosen at OOBE. | 361 // Tests that the server values are added to the values chosen at OOBE. |
362 TEST_F(InputMethodPreferencesTest, TestOobeAndSync) { | 362 TEST_F(InputMethodPreferencesTest, TestOobeAndSync) { |
363 // Choose options at OOBE. | 363 // Choose options at OOBE. |
364 pref_service_->SetBoolean( | 364 pref_service_->SetBoolean( |
365 prefs::kLanguageShouldMergeInputMethods, true); | 365 prefs::kLanguageShouldMergeInputMethods, true); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 "Syncable values should have added local values on initialization."); | 698 "Syncable values should have added local values on initialization."); |
699 ExpectGlobalValues( | 699 ExpectGlobalValues( |
700 "es,en-US", | 700 "es,en-US", |
701 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," + | 701 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," + |
702 ToInputMethodIds("xkb:jp::jpn"), | 702 ToInputMethodIds("xkb:jp::jpn"), |
703 std::string(kIdentityIMEID) + "," + kUnknownIMEID); | 703 std::string(kIdentityIMEID) + "," + kUnknownIMEID); |
704 } | 704 } |
705 } | 705 } |
706 | 706 |
707 } // namespace chromeos | 707 } // namespace chromeos |
OLD | NEW |