| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |