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

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: Comments addressed and rebased. 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
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..b6688b78d4a4be85ceb86d513213215b38598a5a 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"
mtomasz 2014/08/22 05:43:40 The chrome_constants.h include is not used anymore
dzhioev (left Google) 2014/08/25 17:39:11 Done.
#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) {
mtomasz 2014/08/22 05:43:40 nit: This utility method became trivial, so we sho
dzhioev (left Google) 2014/08/25 17:39:11 Done.
- 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::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 = CreateProfileWithName("user1");
+ Profile* profile2 = CreateProfileWithName("user2");
+ std::string user1_id_hash =
mtomasz 2014/08/22 05:43:40 optional: const would be nice, but it seems that i
dzhioev (left Google) 2014/08/25 17:39:11 Done.
+ chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting("user1");
+ 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")));
}

Powered by Google App Engine
This is Rietveld 408576698