Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: chrome/browser/chromeos/preferences_unittest.cc

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/prefs/pref_member.h" 7 #include "base/prefs/pref_member.h"
8 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 8 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
9 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" 9 #include "chrome/browser/chromeos/login/users/fake_user_manager.h"
10 #include "chrome/browser/chromeos/login/users/user_manager.h" 10 #include "chrome/browser/chromeos/login/users/user_manager.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 StringPrefMember* previous_; 43 StringPrefMember* previous_;
44 StringPrefMember* current_; 44 StringPrefMember* current_;
45 }; 45 };
46 46
47 } // anonymous namespace 47 } // anonymous namespace
48 48
49 TEST(PreferencesTest, TestUpdatePrefOnBrowserScreenDetails) { 49 TEST(PreferencesTest, TestUpdatePrefOnBrowserScreenDetails) {
50 chromeos::FakeUserManager* user_manager = new chromeos::FakeUserManager(); 50 chromeos::FakeUserManager* user_manager = new chromeos::FakeUserManager();
51 chromeos::ScopedUserManagerEnabler user_manager_enabler(user_manager); 51 chromeos::ScopedUserManagerEnabler user_manager_enabler(user_manager);
52 const char test_user_email[] = "test_user@example.com"; 52 const char test_user_email[] = "test_user@example.com";
53 const User* test_user = user_manager->AddUser(test_user_email); 53 const user_manager::User* test_user = user_manager->AddUser(test_user_email);
54 user_manager->LoginUser(test_user_email); 54 user_manager->LoginUser(test_user_email);
55 55
56 TestingPrefServiceSyncable prefs; 56 TestingPrefServiceSyncable prefs;
57 Preferences::RegisterProfilePrefs(prefs.registry()); 57 Preferences::RegisterProfilePrefs(prefs.registry());
58 DownloadPrefs::RegisterProfilePrefs(prefs.registry()); 58 DownloadPrefs::RegisterProfilePrefs(prefs.registry());
59 // kSelectFileLastDirectory is registered for Profile. Here we register it for 59 // kSelectFileLastDirectory is registered for Profile. Here we register it for
60 // testing. 60 // testing.
61 prefs.registry()->RegisterStringPref( 61 prefs.registry()->RegisterStringPref(
62 prefs::kSelectFileLastDirectory, 62 prefs::kSelectFileLastDirectory,
63 std::string(), 63 std::string(),
(...skipping 11 matching lines...) Expand all
75 testee.InitUserPrefsForTesting(&prefs, test_user); 75 testee.InitUserPrefsForTesting(&prefs, test_user);
76 testee.SetInputMethodListForTesting(); 76 testee.SetInputMethodListForTesting();
77 77
78 // Confirm they're unchanged. 78 // Confirm they're unchanged.
79 EXPECT_EQ("KeyboardA", previous.GetValue()); 79 EXPECT_EQ("KeyboardA", previous.GetValue());
80 EXPECT_EQ("KeyboardB", current.GetValue()); 80 EXPECT_EQ("KeyboardB", current.GetValue());
81 EXPECT_EQ("KeyboardB", mock_manager.last_input_method_id_); 81 EXPECT_EQ("KeyboardB", mock_manager.last_input_method_id_);
82 } 82 }
83 83
84 } // namespace chromeos 84 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences_browsertest.cc ('k') | chrome/browser/chromeos/profiles/profile_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698