OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/history/history_backend.h" | 10 #include "chrome/browser/history/history_backend.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { | 195 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { |
196 DCHECK(history_service_.get()); | 196 DCHECK(history_service_.get()); |
197 DCHECK(MessageLoop::current()); | 197 DCHECK(MessageLoop::current()); |
198 | 198 |
199 CancelableRequestConsumer consumer; | 199 CancelableRequestConsumer consumer; |
200 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); | 200 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); |
201 MessageLoop::current()->Run(); | 201 MessageLoop::current()->Run(); |
202 } | 202 } |
203 | 203 |
204 void TestingProfile::CreateProfileSyncService() { | 204 void TestingProfile::CreateProfileSyncService() { |
205 #if defined(BROWSER_SYNC) | |
206 if (!profile_sync_service_.get()) { | 205 if (!profile_sync_service_.get()) { |
207 profile_sync_service_.reset(new ProfileSyncService(this)); | 206 profile_sync_service_.reset(new ProfileSyncService(this)); |
208 profile_sync_service_->Initialize(); | 207 profile_sync_service_->Initialize(); |
209 } | 208 } |
210 #endif | |
211 } | 209 } |
212 | 210 |
213 ProfileSyncService* TestingProfile::GetProfileSyncService() { | 211 ProfileSyncService* TestingProfile::GetProfileSyncService() { |
214 #if defined(BROWSER_SYNC) | |
215 return profile_sync_service_.get(); | 212 return profile_sync_service_.get(); |
216 #endif | |
217 return NULL; | |
218 } | 213 } |
OLD | NEW |