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

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

Issue 7621031: Revert 97049 - Trying to see if it fixes sync_integration_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/testing_profile_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/test/base/testing_profile_manager.h"
6
7 #include <algorithm>
8
9 #include "base/utf_string_conversions.h"
10
11 TestingProfileManager::TestingProfileManager() {
12 }
13
14 TestingProfileManager::~TestingProfileManager() {
15 }
16
17 // static
18 AvatarMenuModel::Item* TestingProfileManager::CreateFakeInfo(std::string name) {
19 AvatarMenuModel::Item* item =
20 new AvatarMenuModel::Item(0, FakeProfileInfo::GetTestImage());
21 item->name = UTF8ToUTF16(name);
22 return item;
23 }
24
25 void TestingProfileManager::AddTestingProfile(TestingProfile* profile,
26 AvatarMenuModel::Item* info) {
27 testing_profiles_.insert(std::make_pair(profile, info));
28 fake_profile_info_.mock_profiles()->push_back(info);
29 }
30
31 void TestingProfileManager::RemoveTestingProfile(TestingProfile* profile) {
32 std::map<TestingProfile*, AvatarMenuModel::Item*>::iterator it(
33 testing_profiles_.find(profile));
34 DCHECK(it != testing_profiles_.end());
35
36 AvatarMenuModel::Item* info = it->second;
37 std::vector<AvatarMenuModel::Item*>* info_list =
38 fake_profile_info_.mock_profiles();
39 std::vector<AvatarMenuModel::Item*>::iterator info_it(
40 std::find(info_list->begin(), info_list->end(), info));
41 DCHECK(info_it != fake_profile_info_.mock_profiles()->end());
42
43 testing_profiles_.erase(it);
44 fake_profile_info_.mock_profiles()->erase(info_it);
45 }
46
47 ProfileInfoInterface& TestingProfileManager::GetProfileInfo() {
48 return fake_profile_info_;
49 }
50
51 ProfileInfoCache& TestingProfileManager::GetMutableProfileInfo() {
52 NOTIMPLEMENTED();
53 return ProfileManager::GetMutableProfileInfo();
54 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698