| Index: chrome/browser/chromeos/drive/file_system_util_unittest.cc
|
| diff --git a/chrome/browser/chromeos/drive/file_system_util_unittest.cc b/chrome/browser/chromeos/drive/file_system_util_unittest.cc
|
| index b5873f8977f5511b4c2ed6dd5a22b6f8d7cc6a9e..6afae98839dfaba5e1385ad72b3501eaada4aa1e 100644
|
| --- a/chrome/browser/chromeos/drive/file_system_util_unittest.cc
|
| +++ b/chrome/browser/chromeos/drive/file_system_util_unittest.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/files/scoped_temp_dir.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| +#include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/test/base/testing_browser_process.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| @@ -42,8 +43,7 @@ class ProfileRelatedFileSystemUtilTest : public testing::Test {
|
| }
|
|
|
| Profile* CreateProfileWithName(const std::string& name) {
|
| - return testing_profile_manager_.CreateTestingProfile(
|
| - chrome::kProfileDirPrefix + name);
|
| + return testing_profile_manager_.CreateTestingProfile(name);
|
| }
|
|
|
| private:
|
| @@ -79,18 +79,26 @@ TEST(FileSystemUtilTest, FilePathToDriveURL) {
|
| }
|
|
|
| TEST_F(ProfileRelatedFileSystemUtilTest, GetDriveMountPointPath) {
|
| - Profile* profile = CreateProfileWithName("hash1");
|
| - EXPECT_EQ(base::FilePath::FromUTF8Unsafe("/special/drive-hash1"),
|
| + Profile* profile = CreateProfileWithName("user1");
|
| + std::string user_id_hash =
|
| + chromeos::ProfileHelper::Get()->GetUserIdHashByUserIdForTests("user1");
|
| + EXPECT_EQ(base::FilePath::FromUTF8Unsafe("/special/drive-" + user_id_hash),
|
| GetDriveMountPointPath(profile));
|
| }
|
|
|
| TEST_F(ProfileRelatedFileSystemUtilTest, ExtractProfileFromPath) {
|
| - Profile* profile1 = CreateProfileWithName("hash1");
|
| - Profile* profile2 = CreateProfileWithName("hash2");
|
| - EXPECT_EQ(profile1, ExtractProfileFromPath(
|
| - base::FilePath::FromUTF8Unsafe("/special/drive-hash1")));
|
| - EXPECT_EQ(profile2, ExtractProfileFromPath(
|
| - base::FilePath::FromUTF8Unsafe("/special/drive-hash2/root/xxx")));
|
| + Profile* profile1 = CreateProfileWithName("user1");
|
| + Profile* profile2 = CreateProfileWithName("user2");
|
| + std::string user1_id_hash =
|
| + chromeos::ProfileHelper::Get()->GetUserIdHashByUserIdForTests("user1");
|
| + std::string user2_id_hash =
|
| + chromeos::ProfileHelper::Get()->GetUserIdHashByUserIdForTests("user2");
|
| + EXPECT_EQ(profile1,
|
| + ExtractProfileFromPath(base::FilePath::FromUTF8Unsafe(
|
| + "/special/drive-" + user1_id_hash)));
|
| + EXPECT_EQ(profile2,
|
| + ExtractProfileFromPath(base::FilePath::FromUTF8Unsafe(
|
| + "/special/drive-" + user2_id_hash + "/root/xxx")));
|
| EXPECT_EQ(NULL, ExtractProfileFromPath(
|
| base::FilePath::FromUTF8Unsafe("/special/non-drive-path")));
|
| }
|
|
|