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

Unified Diff: chrome/browser/chromeos/drive/file_system_util_unittest.cc

Issue 442043002: ProfileManager doesn't depend on "--login-profile" switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/path_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dda5280038c8b7dec81cc1dd80a2eb968353d0af..b3d7a48e19abb2fbbd0ad2057e756034548cc37a 100644
--- a/chrome/browser/chromeos/drive/file_system_util_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system_util_unittest.cc
@@ -9,7 +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/common/chrome_constants.h"
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
@@ -41,9 +41,8 @@ class ProfileRelatedFileSystemUtilTest : public testing::Test {
ASSERT_TRUE(testing_profile_manager_.SetUp());
}
- Profile* CreateProfileWithName(const std::string& name) {
- return testing_profile_manager_.CreateTestingProfile(
- chrome::kProfileDirPrefix + name);
+ TestingProfileManager& testing_profile_manager() {
+ return testing_profile_manager_;
}
private:
@@ -79,18 +78,26 @@ TEST(FileSystemUtilTest, FilePathToDriveURL) {
}
TEST_F(ProfileRelatedFileSystemUtilTest, GetDriveMountPointPath) {
- Profile* profile = CreateProfileWithName("hash1");
- EXPECT_EQ(base::FilePath::FromUTF8Unsafe("/special/drive-hash1"),
+ Profile* profile = testing_profile_manager().CreateTestingProfile("user1");
+ const std::string user_id_hash =
+ chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting("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 = testing_profile_manager().CreateTestingProfile("user1");
+ Profile* profile2 = testing_profile_manager().CreateTestingProfile("user2");
+ const std::string user1_id_hash =
+ chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting("user1");
+ const std::string user2_id_hash =
+ chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting("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")));
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/path_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698