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

Side by Side Diff: chrome/test/testing_profile.cc

Issue 6894027: Initial refactoring complete Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed some tests that were broken by previous refactoring Created 9 years, 8 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/testing_profile.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
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/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 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/content_settings/host_content_settings_map.h" 17 #include "chrome/browser/content_settings/host_content_settings_map.h"
18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
19 #include "chrome/browser/extensions/extension_pref_value_map.h" 19 #include "chrome/browser/extensions/extension_pref_value_map.h"
20 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/extension_special_storage_policy.h" 21 #include "chrome/browser/extensions/extension_special_storage_policy.h"
22 #include "chrome/browser/favicon_service.h" 22 #include "chrome/browser/favicon_service.h"
23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
24 #include "chrome/browser/history/history.h" 24 #include "chrome/browser/history/history.h"
25 #include "chrome/browser/history/history_backend.h" 25 #include "chrome/browser/history/history_backend.h"
26 #include "chrome/browser/history/top_sites.h" 26 #include "chrome/browser/history/top_sites.h"
27 #include "chrome/browser/net/gaia/token_service.h" 27 #include "chrome/browser/net/gaia/token_service.h"
28 #include "chrome/browser/net/gaia/authentication_service.h"
28 #include "chrome/browser/net/pref_proxy_config_service.h" 29 #include "chrome/browser/net/pref_proxy_config_service.h"
29 #include "chrome/browser/notifications/desktop_notification_service.h" 30 #include "chrome/browser/notifications/desktop_notification_service.h"
30 #include "chrome/browser/prefs/browser_prefs.h" 31 #include "chrome/browser/prefs/browser_prefs.h"
31 #include "chrome/browser/prefs/testing_pref_store.h" 32 #include "chrome/browser/prefs/testing_pref_store.h"
32 #include "chrome/browser/prerender/prerender_manager.h" 33 #include "chrome/browser/prerender/prerender_manager.h"
33 #include "chrome/browser/profiles/profile_dependency_manager.h" 34 #include "chrome/browser/profiles/profile_dependency_manager.h"
34 #include "chrome/browser/search_engines/template_url_fetcher.h" 35 #include "chrome/browser/search_engines/template_url_fetcher.h"
35 #include "chrome/browser/search_engines/template_url_model.h" 36 #include "chrome/browser/search_engines/template_url_model.h"
36 #include "chrome/browser/sessions/session_service.h" 37 #include "chrome/browser/sessions/session_service.h"
37 #include "chrome/browser/sync/profile_sync_service_mock.h" 38 #include "chrome/browser/sync/profile_sync_service_mock.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 729
729 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { 730 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() {
730 DCHECK(history_service_.get()); 731 DCHECK(history_service_.get());
731 DCHECK(MessageLoop::current()); 732 DCHECK(MessageLoop::current());
732 733
733 CancelableRequestConsumer consumer; 734 CancelableRequestConsumer consumer;
734 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); 735 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer);
735 MessageLoop::current()->Run(); 736 MessageLoop::current()->Run();
736 } 737 }
737 738
739 AuthenticationService* TestingProfile::GetAuthenticationService() {
740 if (!authentication_service_.get()) {
741 authentication_service_.reset(new AuthenticationService());
742 }
743 return authentication_service_.get();
744 }
745
738 TokenService* TestingProfile::GetTokenService() { 746 TokenService* TestingProfile::GetTokenService() {
739 if (!token_service_.get()) { 747 if (!token_service_.get()) {
740 token_service_.reset(new TokenService()); 748 token_service_.reset(new TokenService());
741 } 749 }
742 return token_service_.get(); 750 return token_service_.get();
743 } 751 }
744 752
745 ProfileSyncService* TestingProfile::GetProfileSyncService() { 753 ProfileSyncService* TestingProfile::GetProfileSyncService() {
746 return GetProfileSyncService(""); 754 return GetProfileSyncService("");
747 } 755 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 } 816 }
809 817
810 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) 818 DerivedTestingProfile::DerivedTestingProfile(Profile* profile)
811 : original_profile_(profile) {} 819 : original_profile_(profile) {}
812 820
813 DerivedTestingProfile::~DerivedTestingProfile() {} 821 DerivedTestingProfile::~DerivedTestingProfile() {}
814 822
815 ProfileId DerivedTestingProfile::GetRuntimeId() { 823 ProfileId DerivedTestingProfile::GetRuntimeId() {
816 return original_profile_->GetRuntimeId(); 824 return original_profile_->GetRuntimeId();
817 } 825 }
OLDNEW
« no previous file with comments | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698