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

Unified Diff: chrome/browser/profiles/profile_browsertest.cc

Issue 2053143002: Supports multiple profiles when DiskCacheDir is overridden by command line switches or group policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux trybot failure Created 4 years, 6 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/profiles/profile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_browsertest.cc
diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc
index bfd95e271eeaa52c4b47dcc4fab1e093a76209bf..461d7867374619a6558ead2a31b4c641bf198831 100644
--- a/chrome/browser/profiles/profile_browsertest.cc
+++ b/chrome/browser/profiles/profile_browsertest.cc
@@ -687,3 +687,35 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest,
incognito_browser,
incognito_browser->profile()->GetRequestContextForExtensions());
}
+
+// Verifies the cache directory supports multiple profiles when it's overriden
+// by group policy or command line switches.
+IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, DiskCacheDirOverride) {
+ int size;
+ const base::FilePath::StringPieceType profile_name =
+ FILE_PATH_LITERAL("Profile 1");
+ base::ScopedTempDir mock_user_data_dir;
+ ASSERT_TRUE(mock_user_data_dir.CreateUniqueTempDir());
+ base::FilePath profile_path = mock_user_data_dir.path().Append(profile_name);
+ ProfileImpl* profile_impl = static_cast<ProfileImpl*>(browser()->profile());
+
+ {
+ profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir,
+ base::FilePath());
+
+ base::FilePath cache_path = profile_path;
+ profile_impl->GetCacheParameters(false, &cache_path, &size);
+ EXPECT_EQ(profile_path, cache_path);
+ }
+
+ {
+ base::ScopedTempDir temp_disk_cache_dir;
+ ASSERT_TRUE(temp_disk_cache_dir.CreateUniqueTempDir());
+ profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir,
+ temp_disk_cache_dir.path());
+
+ base::FilePath cache_path = profile_path;
+ profile_impl->GetCacheParameters(false, &cache_path, &size);
+ EXPECT_EQ(temp_disk_cache_dir.path().Append(profile_name), cache_path);
+ }
+}
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698