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

Side by Side Diff: chrome/test/base/testing_profile_manager.cc

Issue 823703004: Tracking push events for lucid sleep (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 11 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
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/test/base/testing_profile_manager.h" 5 #include "chrome/test/base/testing_profile_manager.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/prefs/pref_service_syncable.h" 9 #include "chrome/browser/prefs/pref_service_syncable.h"
10 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 TestingProfilesMap::iterator it = testing_profiles_.find(name); 142 TestingProfilesMap::iterator it = testing_profiles_.find(name);
143 DCHECK(it != testing_profiles_.end()); 143 DCHECK(it != testing_profiles_.end());
144 144
145 TestingProfile* profile = it->second; 145 TestingProfile* profile = it->second;
146 146
147 ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache(); 147 ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
148 cache.DeleteProfileFromCache(profile->GetPath()); 148 cache.DeleteProfileFromCache(profile->GetPath());
149 149
150 profile_manager_->profiles_info_.erase(profile->GetPath()); 150 profile_manager_->profiles_info_.erase(profile->GetPath());
151
152 testing_profiles_.erase(it);
151 } 153 }
152 154
153 void TestingProfileManager::DeleteAllTestingProfiles() { 155 void TestingProfileManager::DeleteAllTestingProfiles() {
154 for (TestingProfilesMap::iterator it = testing_profiles_.begin(); 156 for (TestingProfilesMap::iterator it = testing_profiles_.begin();
155 it != testing_profiles_.end(); ++it) { 157 it != testing_profiles_.end(); ++it) {
156 TestingProfile* profile = it->second; 158 TestingProfile* profile = it->second;
157 ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache(); 159 ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
158 cache.DeleteProfileFromCache(profile->GetPath()); 160 cache.DeleteProfileFromCache(profile->GetPath());
159 } 161 }
160 testing_profiles_.clear(); 162 testing_profiles_.clear();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 << "ProfileManager already exists"; 206 << "ProfileManager already exists";
205 207
206 // Set up the directory for profiles. 208 // Set up the directory for profiles.
207 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); 209 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir());
208 210
209 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); 211 profile_manager_ = new testing::ProfileManager(profiles_dir_.path());
210 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. 212 browser_process_->SetProfileManager(profile_manager_); // Takes ownership.
211 213
212 called_set_up_ = true; 214 called_set_up_ = true;
213 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698