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

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

Issue 1019283004: Switch to direct use of OwnerSettingsServiceChromeOS::Set() in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rearrange device settings list. Created 5 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 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 protected: 55 protected:
56 void SetUp() override { 56 void SetUp() override {
57 base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); 57 base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
58 command_line.AppendSwitch(::switches::kTestType); 58 command_line.AppendSwitch(::switches::kTestType);
59 command_line.AppendSwitch( 59 command_line.AppendSwitch(
60 chromeos::switches::kIgnoreUserProfileMappingForTests); 60 chromeos::switches::kIgnoreUserProfileMappingForTests);
61 61
62 cros_settings_ = CrosSettings::Get(); 62 cros_settings_ = CrosSettings::Get();
63 63
64 // Replace the real DeviceSettingsProvider with a stub. 64 // Replace the real DeviceSettingsProvider with a stub.
65 device_settings_provider_ = 65 device_settings_provider_ = cros_settings_->GetProvider(kDeviceOwner);
66 cros_settings_->GetProvider(chromeos::kReportDeviceVersionInfo);
67 EXPECT_TRUE(device_settings_provider_); 66 EXPECT_TRUE(device_settings_provider_);
68 EXPECT_TRUE( 67 EXPECT_TRUE(
69 cros_settings_->RemoveSettingsProvider(device_settings_provider_)); 68 cros_settings_->RemoveSettingsProvider(device_settings_provider_));
70 cros_settings_->AddSettingsProvider(&stub_settings_provider_); 69 cros_settings_->AddSettingsProvider(&stub_settings_provider_);
71 70
72 // Populate the stub DeviceSettingsProvider with valid values. 71 // Populate the stub DeviceSettingsProvider with valid values.
73 SetDeviceSettings(false, "", false); 72 SetDeviceSettings(false, "", false);
74 73
75 // Register an in-memory local settings instance. 74 // Register an in-memory local settings instance.
76 local_state_.reset( 75 local_state_.reset(
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 "user0@invalid.domain", "user0@invalid.domain", false); 216 "user0@invalid.domain", "user0@invalid.domain", false);
218 ResetUserManager(); 217 ResetUserManager();
219 218
220 const user_manager::UserList* users = 219 const user_manager::UserList* users =
221 &user_manager::UserManager::Get()->GetUsers(); 220 &user_manager::UserManager::Get()->GetUsers();
222 EXPECT_EQ(1U, users->size()); 221 EXPECT_EQ(1U, users->size());
223 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain"); 222 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain");
224 } 223 }
225 224
226 } // namespace chromeos 225 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698