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

Side by Side Diff: chrome/browser/chromeos/login/users/user_manager_unittest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
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 <cstdlib> 5 #include <cstdlib>
6 #include <cstring> 6 #include <cstring>
7 #include <memory>
7 8
8 #include "base/command_line.h" 9 #include "base/command_line.h"
9 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 11 #include "base/files/scoped_temp_dir.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" 14 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
16 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 16 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
17 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" 17 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
18 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/test/base/scoped_testing_local_state.h" 19 #include "chrome/test/base/scoped_testing_local_state.h"
20 #include "chrome/test/base/testing_browser_process.h" 20 #include "chrome/test/base/testing_browser_process.h"
21 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 AccountId::FromUserEmail("owner@invalid.domain"); 140 AccountId::FromUserEmail("owner@invalid.domain");
141 const AccountId account_id0_at_invalid_domain_ = 141 const AccountId account_id0_at_invalid_domain_ =
142 AccountId::FromUserEmail("user0@invalid.domain"); 142 AccountId::FromUserEmail("user0@invalid.domain");
143 const AccountId account_id1_at_invalid_domain_ = 143 const AccountId account_id1_at_invalid_domain_ =
144 AccountId::FromUserEmail("user1@invalid.domain"); 144 AccountId::FromUserEmail("user1@invalid.domain");
145 145
146 protected: 146 protected:
147 content::TestBrowserThreadBundle thread_bundle_; 147 content::TestBrowserThreadBundle thread_bundle_;
148 148
149 ScopedCrosSettingsTestHelper settings_helper_; 149 ScopedCrosSettingsTestHelper settings_helper_;
150 scoped_ptr<ScopedTestingLocalState> local_state_; 150 std::unique_ptr<ScopedTestingLocalState> local_state_;
151 151
152 scoped_ptr<ScopedUserManagerEnabler> user_manager_enabler_; 152 std::unique_ptr<ScopedUserManagerEnabler> user_manager_enabler_;
153 base::ScopedTempDir temp_dir_; 153 base::ScopedTempDir temp_dir_;
154 }; 154 };
155 155
156 TEST_F(UserManagerTest, RetrieveTrustedDevicePolicies) { 156 TEST_F(UserManagerTest, RetrieveTrustedDevicePolicies) {
157 SetUserManagerEphemeralUsersEnabled(true); 157 SetUserManagerEphemeralUsersEnabled(true);
158 SetUserManagerOwnerId(EmptyAccountId()); 158 SetUserManagerOwnerId(EmptyAccountId());
159 159
160 SetDeviceSettings(false, owner_account_id_at_invalid_domain_.GetUserEmail(), 160 SetDeviceSettings(false, owner_account_id_at_invalid_domain_.GetUserEmail(),
161 false); 161 false);
162 RetrieveTrustedDevicePolicies(); 162 RetrieveTrustedDevicePolicies();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 account_id0_at_invalid_domain_.GetUserEmail(), false); 209 account_id0_at_invalid_domain_.GetUserEmail(), false);
210 ResetUserManager(); 210 ResetUserManager();
211 211
212 const user_manager::UserList* users = 212 const user_manager::UserList* users =
213 &user_manager::UserManager::Get()->GetUsers(); 213 &user_manager::UserManager::Get()->GetUsers();
214 EXPECT_EQ(1U, users->size()); 214 EXPECT_EQ(1U, users->size());
215 EXPECT_EQ((*users)[0]->GetAccountId(), owner_account_id_at_invalid_domain_); 215 EXPECT_EQ((*users)[0]->GetAccountId(), owner_account_id_at_invalid_domain_);
216 } 216 }
217 217
218 } // namespace chromeos 218 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698