| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 589 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 590 | 590 |
| 591 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 591 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 592 ASSERT_TRUE(profile_manager); | 592 ASSERT_TRUE(profile_manager); |
| 593 std::vector<Profile*> loaded_profiles = profile_manager->GetLoadedProfiles(); | 593 std::vector<Profile*> loaded_profiles = profile_manager->GetLoadedProfiles(); |
| 594 | 594 |
| 595 ASSERT_NE(loaded_profiles.size(), 0UL); | 595 ASSERT_NE(loaded_profiles.size(), 0UL); |
| 596 Profile* profile = loaded_profiles[0]; | 596 Profile* profile = loaded_profiles[0]; |
| 597 | 597 |
| 598 #if defined(OS_CHROMEOS) | 598 #if defined(OS_CHROMEOS) |
| 599 for (const auto& loaded_profile : loaded_profiles) { | 599 for (auto* loaded_profile : loaded_profiles) { |
| 600 if (!chromeos::ProfileHelper::IsSigninProfile(loaded_profile)) { | 600 if (!chromeos::ProfileHelper::IsSigninProfile(loaded_profile)) { |
| 601 profile = loaded_profile; | 601 profile = loaded_profile; |
| 602 break; | 602 break; |
| 603 } | 603 } |
| 604 } | 604 } |
| 605 #endif | 605 #endif |
| 606 | 606 |
| 607 // This retry loop reduces flakiness due to the fact that this ultimately | 607 // This retry loop reduces flakiness due to the fact that this ultimately |
| 608 // tests whether or not a code path hits a timed wait. | 608 // tests whether or not a code path hits a timed wait. |
| 609 bool succeeded = false; | 609 bool succeeded = false; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 base::ScopedTempDir temp_disk_cache_dir; | 712 base::ScopedTempDir temp_disk_cache_dir; |
| 713 ASSERT_TRUE(temp_disk_cache_dir.CreateUniqueTempDir()); | 713 ASSERT_TRUE(temp_disk_cache_dir.CreateUniqueTempDir()); |
| 714 profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir, | 714 profile_impl->GetPrefs()->SetFilePath(prefs::kDiskCacheDir, |
| 715 temp_disk_cache_dir.path()); | 715 temp_disk_cache_dir.path()); |
| 716 | 716 |
| 717 base::FilePath cache_path = profile_path; | 717 base::FilePath cache_path = profile_path; |
| 718 profile_impl->GetCacheParameters(false, &cache_path, &size); | 718 profile_impl->GetCacheParameters(false, &cache_path, &size); |
| 719 EXPECT_EQ(temp_disk_cache_dir.path().Append(profile_name), cache_path); | 719 EXPECT_EQ(temp_disk_cache_dir.path().Append(profile_name), cache_path); |
| 720 } | 720 } |
| 721 } | 721 } |
| OLD | NEW |