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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 680
681 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, 681 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest,
682 URLFetcherUsingExtensionContextDuringIncognitoTeardown) { 682 URLFetcherUsingExtensionContextDuringIncognitoTeardown) {
683 Browser* incognito_browser = 683 Browser* incognito_browser =
684 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); 684 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank"));
685 685
686 RunURLFetcherActiveDuringIncognitoTeardownTest( 686 RunURLFetcherActiveDuringIncognitoTeardownTest(
687 incognito_browser, 687 incognito_browser,
688 incognito_browser->profile()->GetRequestContextForExtensions()); 688 incognito_browser->profile()->GetRequestContextForExtensions());
689 } 689 }
690
691 // Verifies the cache directory supports multiple profiles when it's overriden
692 // by group policy or command line switches.
693 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, DiskCacheDirOverride) {
694 int size;
695 const base::FilePath::StringPieceType profile_name =
696 FILE_PATH_LITERAL("Profile 1");
697 base::ScopedTempDir mock_user_data_dir;
698 ASSERT_TRUE(mock_user_data_dir.CreateUniqueTempDir());
699 base::FilePath profile_path = mock_user_data_dir.path().Append(profile_name);
700 ProfileImpl* profile_impl = static_cast<ProfileImpl*>(browser()->profile());
701
702 {
703 profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir,
704 base::FilePath());
705
706 base::FilePath cache_path = profile_path;
707 profile_impl->GetCacheParameters(false, &cache_path, &size);
708 EXPECT_EQ(profile_path, cache_path);
709 }
710
711 {
712 base::ScopedTempDir temp_disk_cache_dir;
713 ASSERT_TRUE(temp_disk_cache_dir.CreateUniqueTempDir());
714 profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir,
715 temp_disk_cache_dir.path());
716
717 base::FilePath cache_path = profile_path;
718 profile_impl->GetCacheParameters(false, &cache_path, &size);
719 EXPECT_EQ(temp_disk_cache_dir.path().Append(profile_name), cache_path);
720 }
721 }
OLDNEW
« 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