| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return NULL; | 47 return NULL; |
| 48 } | 48 } |
| 49 return new TestingProfile(file_path, NULL); | 49 return new TestingProfile(file_path, NULL); |
| 50 } | 50 } |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 | 53 |
| 54 class UserManagerTest : public testing::Test { | 54 class UserManagerTest : public testing::Test { |
| 55 protected: | 55 protected: |
| 56 virtual void SetUp() override { | 56 virtual void SetUp() override { |
| 57 CommandLine& command_line = *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_ = |
| 66 cros_settings_->GetProvider(chromeos::kReportDeviceVersionInfo); | 66 cros_settings_->GetProvider(chromeos::kReportDeviceVersionInfo); |
| 67 EXPECT_TRUE(device_settings_provider_); | 67 EXPECT_TRUE(device_settings_provider_); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 "user0@invalid.domain", "user0@invalid.domain", false); | 215 "user0@invalid.domain", "user0@invalid.domain", false); |
| 216 ResetUserManager(); | 216 ResetUserManager(); |
| 217 | 217 |
| 218 const user_manager::UserList* users = | 218 const user_manager::UserList* users = |
| 219 &user_manager::UserManager::Get()->GetUsers(); | 219 &user_manager::UserManager::Get()->GetUsers(); |
| 220 EXPECT_EQ(1U, users->size()); | 220 EXPECT_EQ(1U, users->size()); |
| 221 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain"); | 221 EXPECT_EQ((*users)[0]->email(), "owner@invalid.domain"); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace chromeos | 224 } // namespace chromeos |
| OLD | NEW |