| OLD | NEW |
| 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 // An implementation of BrowserProcess for unit tests that fails for most | 5 // An implementation of BrowserProcess for unit tests that fails for most |
| 6 // services. By preventing creation of services, we reduce dependencies and | 6 // services. By preventing creation of services, we reduce dependencies and |
| 7 // keep the profile clean. Clients of this class must handle the NULL return | 7 // keep the profile clean. Clients of this class must handle the NULL return |
| 8 // value, however. | 8 // value, however. |
| 9 | 9 |
| 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace content { | 29 namespace content { |
| 30 class NotificationService; | 30 class NotificationService; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace policy { | 33 namespace policy { |
| 34 class BrowserPolicyConnector; | 34 class BrowserPolicyConnector; |
| 35 class PolicyService; | 35 class PolicyService; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace prerender { | 38 namespace prerender { |
| 39 class PrerenderTracker; | 39 class PrerenderRenderViewTracker; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace ui { | 42 namespace ui { |
| 43 class Clipboard; | 43 class Clipboard; |
| 44 } | 44 } |
| 45 | 45 |
| 46 class TestingBrowserProcess : public BrowserProcess { | 46 class TestingBrowserProcess : public BrowserProcess { |
| 47 public: | 47 public: |
| 48 TestingBrowserProcess(); | 48 TestingBrowserProcess(); |
| 49 virtual ~TestingBrowserProcess(); | 49 virtual ~TestingBrowserProcess(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 virtual void SetApplicationLocale(const std::string& app_locale) OVERRIDE; | 95 virtual void SetApplicationLocale(const std::string& app_locale) OVERRIDE; |
| 96 virtual DownloadStatusUpdater* download_status_updater() OVERRIDE; | 96 virtual DownloadStatusUpdater* download_status_updater() OVERRIDE; |
| 97 virtual DownloadRequestLimiter* download_request_limiter() OVERRIDE; | 97 virtual DownloadRequestLimiter* download_request_limiter() OVERRIDE; |
| 98 virtual bool plugin_finder_disabled() const OVERRIDE; | 98 virtual bool plugin_finder_disabled() const OVERRIDE; |
| 99 | 99 |
| 100 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 100 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 101 virtual void StartAutoupdateTimer() OVERRIDE {} | 101 virtual void StartAutoupdateTimer() OVERRIDE {} |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 virtual ChromeNetLog* net_log() OVERRIDE; | 104 virtual ChromeNetLog* net_log() OVERRIDE; |
| 105 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 105 virtual prerender::PrerenderRenderViewTracker* |
| 106 prerender_render_view_tracker() OVERRIDE; |
| 106 virtual ComponentUpdateService* component_updater() OVERRIDE; | 107 virtual ComponentUpdateService* component_updater() OVERRIDE; |
| 107 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 108 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
| 108 | 109 |
| 109 // Set the local state for tests. Consumer is responsible for cleaning it up | 110 // Set the local state for tests. Consumer is responsible for cleaning it up |
| 110 // afterwards (using ScopedTestingLocalState, for example). | 111 // afterwards (using ScopedTestingLocalState, for example). |
| 111 void SetLocalState(PrefService* local_state); | 112 void SetLocalState(PrefService* local_state); |
| 112 void SetProfileManager(ProfileManager* profile_manager); | 113 void SetProfileManager(ProfileManager* profile_manager); |
| 113 void SetIOThread(IOThread* io_thread); | 114 void SetIOThread(IOThread* io_thread); |
| 114 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); | 115 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); |
| 115 void SetSafeBrowsingService(SafeBrowsingService* sb_service); | 116 void SetSafeBrowsingService(SafeBrowsingService* sb_service); |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 scoped_ptr<content::NotificationService> notification_service_; | 119 scoped_ptr<content::NotificationService> notification_service_; |
| 119 unsigned int module_ref_count_; | 120 unsigned int module_ref_count_; |
| 120 scoped_ptr<ui::Clipboard> clipboard_; | 121 scoped_ptr<ui::Clipboard> clipboard_; |
| 121 std::string app_locale_; | 122 std::string app_locale_; |
| 122 | 123 |
| 123 // Weak pointer. | 124 // Weak pointer. |
| 124 PrefService* local_state_; | 125 PrefService* local_state_; |
| 125 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 126 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 126 scoped_ptr<policy::PolicyService> policy_service_; | 127 scoped_ptr<policy::PolicyService> policy_service_; |
| 127 scoped_ptr<ProfileManager> profile_manager_; | 128 scoped_ptr<ProfileManager> profile_manager_; |
| 128 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 129 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
| 129 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 130 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
| 130 scoped_refptr<printing::PrintPreviewTabController> | 131 scoped_refptr<printing::PrintPreviewTabController> |
| 131 print_preview_tab_controller_; | 132 print_preview_tab_controller_; |
| 132 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 133 scoped_ptr<prerender::PrerenderRenderViewTracker> |
| 134 prerender_render_view_tracker_; |
| 133 IOThread* io_thread_; | 135 IOThread* io_thread_; |
| 134 scoped_refptr<SafeBrowsingService> sb_service_; | 136 scoped_refptr<SafeBrowsingService> sb_service_; |
| 135 | 137 |
| 136 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 138 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 137 }; | 139 }; |
| 138 | 140 |
| 139 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 141 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |