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 <cstdlib> | 5 #include <cstdlib> |
6 #include <cstring> | 6 #include <cstring> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 cros_settings_->RemoveSettingsProvider(device_settings_provider_)); | 53 cros_settings_->RemoveSettingsProvider(device_settings_provider_)); |
54 cros_settings_->AddSettingsProvider(&stub_settings_provider_); | 54 cros_settings_->AddSettingsProvider(&stub_settings_provider_); |
55 | 55 |
56 // Populate the stub DeviceSettingsProvider with valid values. | 56 // Populate the stub DeviceSettingsProvider with valid values. |
57 SetDeviceSettings(false, ""); | 57 SetDeviceSettings(false, ""); |
58 | 58 |
59 // Register an in-memory local settings instance. | 59 // Register an in-memory local settings instance. |
60 local_state_.reset(new TestingPrefServiceSimple); | 60 local_state_.reset(new TestingPrefServiceSimple); |
61 reinterpret_cast<TestingBrowserProcess*>(g_browser_process) | 61 reinterpret_cast<TestingBrowserProcess*>(g_browser_process) |
62 ->SetLocalState(local_state_.get()); | 62 ->SetLocalState(local_state_.get()); |
63 UserManager::RegisterPrefs(local_state_.get()); | 63 UserManager::RegisterPrefs(local_state_->registry()); |
64 // Wallpaper manager and user image managers prefs will be accessed by the | 64 // Wallpaper manager and user image managers prefs will be accessed by the |
65 // unit-test as well. | 65 // unit-test as well. |
66 UserImageManager::RegisterPrefs(local_state_.get()); | 66 UserImageManager::RegisterPrefs(local_state_->registry()); |
67 WallpaperManager::RegisterPrefs(local_state_.get()); | 67 WallpaperManager::RegisterPrefs(local_state_->registry()); |
68 | 68 |
69 old_user_manager_ = UserManager::Get(); | 69 old_user_manager_ = UserManager::Get(); |
70 ResetUserManager(); | 70 ResetUserManager(); |
71 } | 71 } |
72 | 72 |
73 virtual void TearDown() { | 73 virtual void TearDown() { |
74 // Unregister the in-memory local settings instance. | 74 // Unregister the in-memory local settings instance. |
75 reinterpret_cast<TestingBrowserProcess*>(g_browser_process) | 75 reinterpret_cast<TestingBrowserProcess*>(g_browser_process) |
76 ->SetLocalState(0); | 76 ->SetLocalState(0); |
77 | 77 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 ResetUserManager(); | 191 ResetUserManager(); |
192 UserManager::Get()->UserLoggedIn("user0@invalid.domain", false); | 192 UserManager::Get()->UserLoggedIn("user0@invalid.domain", false); |
193 ResetUserManager(); | 193 ResetUserManager(); |
194 | 194 |
195 const UserList* users = &UserManager::Get()->GetUsers(); | 195 const UserList* users = &UserManager::Get()->GetUsers(); |
196 EXPECT_EQ(1U, users->size()); | 196 EXPECT_EQ(1U, users->size()); |
197 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain"); | 197 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain"); |
198 } | 198 } |
199 | 199 |
200 } // namespace chromeos | 200 } // namespace chromeos |
OLD | NEW |