OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/base/testing_profile_manager.h" | 5 #include "chrome/test/base/testing_profile_manager.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ProfileManager* TestingProfileManager::profile_manager() { | 90 ProfileManager* TestingProfileManager::profile_manager() { |
91 DCHECK(called_set_up_); | 91 DCHECK(called_set_up_); |
92 return profile_manager_; | 92 return profile_manager_; |
93 } | 93 } |
94 | 94 |
95 ProfileInfoCache* TestingProfileManager::profile_info_cache() { | 95 ProfileInfoCache* TestingProfileManager::profile_info_cache() { |
96 DCHECK(called_set_up_); | 96 DCHECK(called_set_up_); |
97 return &profile_manager_->GetProfileInfoCache(); | 97 return &profile_manager_->GetProfileInfoCache(); |
98 } | 98 } |
99 | 99 |
| 100 void TestingProfileManager::DeleteProfileInfoCache() { |
| 101 profile_manager_->profile_info_cache_.reset(NULL); |
| 102 } |
| 103 |
100 void TestingProfileManager::SetUpInternal() { | 104 void TestingProfileManager::SetUpInternal() { |
101 ASSERT_FALSE(browser_process_->profile_manager()) | 105 ASSERT_FALSE(browser_process_->profile_manager()) |
102 << "ProfileManager already exists"; | 106 << "ProfileManager already exists"; |
103 | 107 |
104 // Set up the directory for profiles. | 108 // Set up the directory for profiles. |
105 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); | 109 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); |
106 | 110 |
107 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); | 111 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); |
108 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. | 112 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. |
109 | 113 |
110 called_set_up_ = true; | 114 called_set_up_ = true; |
111 } | 115 } |
OLD | NEW |