| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 IN_PROC_BROWSER_TEST_F(ProfileHelperTest, ActiveUserProfileDir) { | 37 IN_PROC_BROWSER_TEST_F(ProfileHelperTest, ActiveUserProfileDir) { |
| 38 ProfileHelper profile_helper; | 38 ProfileHelper profile_helper; |
| 39 ActiveUserChanged(&profile_helper, kActiveUserHash); | 39 ActiveUserChanged(&profile_helper, kActiveUserHash); |
| 40 base::FilePath profile_dir = profile_helper.GetActiveUserProfileDir(); | 40 base::FilePath profile_dir = profile_helper.GetActiveUserProfileDir(); |
| 41 std::string expected_dir; | 41 std::string expected_dir; |
| 42 expected_dir.append(chrome::kProfileDirPrefix); | 42 expected_dir.append(chrome::kProfileDirPrefix); |
| 43 expected_dir.append(kActiveUserHash); | 43 expected_dir.append(kActiveUserHash); |
| 44 EXPECT_EQ(expected_dir, profile_dir.BaseName().value()); | 44 EXPECT_EQ(expected_dir, profile_dir.BaseName().value()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 IN_PROC_BROWSER_TEST_F(ProfileHelperTest, | |
| 48 GetProfileDirByLegacyLoginProfileSwitch) { | |
| 49 CommandLine::ForCurrentProcess()-> | |
| 50 AppendSwitchASCII(chromeos::switches::kLoginProfile, | |
| 51 chrome::kLegacyProfileDir); | |
| 52 EXPECT_EQ(chrome::kLegacyProfileDir, | |
| 53 ProfileHelper::GetProfileDirByLegacyLoginProfileSwitch().value()); | |
| 54 CommandLine::ForCurrentProcess()-> | |
| 55 AppendSwitchASCII(chromeos::switches::kLoginProfile, | |
| 56 chrome::kTestUserProfileDir); | |
| 57 EXPECT_EQ(chrome::kTestUserProfileDir, | |
| 58 ProfileHelper::GetProfileDirByLegacyLoginProfileSwitch().value()); | |
| 59 CommandLine::ForCurrentProcess()-> | |
| 60 AppendSwitchASCII(chromeos::switches::kLoginProfile, | |
| 61 kActiveUserHash); | |
| 62 EXPECT_EQ(std::string(chrome::kProfileDirPrefix) + kActiveUserHash, | |
| 63 ProfileHelper::GetProfileDirByLegacyLoginProfileSwitch().value()); | |
| 64 } | |
| 65 | |
| 66 IN_PROC_BROWSER_TEST_F(ProfileHelperTest, GetProfilePathByUserIdHash) { | 47 IN_PROC_BROWSER_TEST_F(ProfileHelperTest, GetProfilePathByUserIdHash) { |
| 67 ProfileHelper profile_helper; | 48 ProfileHelper profile_helper; |
| 68 base::FilePath profile_path = | 49 base::FilePath profile_path = |
| 69 profile_helper.GetProfilePathByUserIdHash(kActiveUserHash); | 50 profile_helper.GetProfilePathByUserIdHash(kActiveUserHash); |
| 70 base::FilePath expected_path = g_browser_process->profile_manager()-> | 51 base::FilePath expected_path = g_browser_process->profile_manager()-> |
| 71 user_data_dir().Append( | 52 user_data_dir().Append( |
| 72 std::string(chrome::kProfileDirPrefix) + kActiveUserHash); | 53 std::string(chrome::kProfileDirPrefix) + kActiveUserHash); |
| 73 EXPECT_EQ(expected_path, profile_path); | 54 EXPECT_EQ(expected_path, profile_path); |
| 74 } | 55 } |
| 75 | 56 |
| 76 } // namespace chromeos | 57 } // namespace chromeos |
| OLD | NEW |