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 #include "chrome/test/base/testing_browser_process.h" | 5 #include "chrome/test/base/testing_browser_process.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/time/default_clock.h" | 9 #include "base/time/default_clock.h" |
10 #include "base/time/default_tick_clock.h" | 10 #include "base/time/default_tick_clock.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 delete browser_process; | 69 delete browser_process; |
70 } | 70 } |
71 | 71 |
72 TestingBrowserProcess::TestingBrowserProcess() | 72 TestingBrowserProcess::TestingBrowserProcess() |
73 : notification_service_(content::NotificationService::Create()), | 73 : notification_service_(content::NotificationService::Create()), |
74 app_locale_("en"), | 74 app_locale_("en"), |
75 is_shutting_down_(false), | 75 is_shutting_down_(false), |
76 local_state_(nullptr), | 76 local_state_(nullptr), |
77 io_thread_(nullptr), | 77 io_thread_(nullptr), |
78 system_request_context_(nullptr), | 78 system_request_context_(nullptr), |
79 rappor_service_(nullptr), | 79 rappor_service_(nullptr), |
Bryan McQuade
2017/01/26 00:50:59
should set ukm_service_ to nullptr here
| |
80 platform_part_(new TestingBrowserProcessPlatformPart()) { | 80 platform_part_(new TestingBrowserProcessPlatformPart()) { |
81 #if BUILDFLAG(ENABLE_EXTENSIONS) | 81 #if BUILDFLAG(ENABLE_EXTENSIONS) |
82 extensions_browser_client_.reset( | 82 extensions_browser_client_.reset( |
83 new extensions::ChromeExtensionsBrowserClient); | 83 new extensions::ChromeExtensionsBrowserClient); |
84 extensions::AppWindowClient::Set(ChromeAppWindowClient::GetInstance()); | 84 extensions::AppWindowClient::Set(ChromeAppWindowClient::GetInstance()); |
85 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); | 85 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
86 #endif | 86 #endif |
87 } | 87 } |
88 | 88 |
89 TestingBrowserProcess::~TestingBrowserProcess() { | 89 TestingBrowserProcess::~TestingBrowserProcess() { |
(...skipping 20 matching lines...) Expand all Loading... | |
110 } | 110 } |
111 | 111 |
112 metrics::MetricsService* TestingBrowserProcess::metrics_service() { | 112 metrics::MetricsService* TestingBrowserProcess::metrics_service() { |
113 return nullptr; | 113 return nullptr; |
114 } | 114 } |
115 | 115 |
116 rappor::RapporServiceImpl* TestingBrowserProcess::rappor_service() { | 116 rappor::RapporServiceImpl* TestingBrowserProcess::rappor_service() { |
117 return rappor_service_; | 117 return rappor_service_; |
118 } | 118 } |
119 | 119 |
120 ukm::UkmService* TestingBrowserProcess::ukm_service() { | |
121 return ukm_service_; | |
122 } | |
123 | |
120 IOThread* TestingBrowserProcess::io_thread() { | 124 IOThread* TestingBrowserProcess::io_thread() { |
121 return io_thread_; | 125 return io_thread_; |
122 } | 126 } |
123 | 127 |
124 WatchDogThread* TestingBrowserProcess::watchdog_thread() { | 128 WatchDogThread* TestingBrowserProcess::watchdog_thread() { |
125 return nullptr; | 129 return nullptr; |
126 } | 130 } |
127 | 131 |
128 ProfileManager* TestingBrowserProcess::profile_manager() { | 132 ProfileManager* TestingBrowserProcess::profile_manager() { |
129 return profile_manager_.get(); | 133 return profile_manager_.get(); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 void TestingBrowserProcess::SetRulesetService( | 462 void TestingBrowserProcess::SetRulesetService( |
459 std::unique_ptr<subresource_filter::RulesetService> ruleset_service) { | 463 std::unique_ptr<subresource_filter::RulesetService> ruleset_service) { |
460 subresource_filter_ruleset_service_.swap(ruleset_service); | 464 subresource_filter_ruleset_service_.swap(ruleset_service); |
461 } | 465 } |
462 | 466 |
463 void TestingBrowserProcess::SetRapporServiceImpl( | 467 void TestingBrowserProcess::SetRapporServiceImpl( |
464 rappor::RapporServiceImpl* rappor_service) { | 468 rappor::RapporServiceImpl* rappor_service) { |
465 rappor_service_ = rappor_service; | 469 rappor_service_ = rappor_service; |
466 } | 470 } |
467 | 471 |
472 void TestingBrowserProcess::SetUkmService(ukm::UkmService* ukm_service) { | |
473 ukm_service_ = ukm_service; | |
474 } | |
475 | |
468 void TestingBrowserProcess::SetShuttingDown(bool is_shutting_down) { | 476 void TestingBrowserProcess::SetShuttingDown(bool is_shutting_down) { |
469 is_shutting_down_ = is_shutting_down; | 477 is_shutting_down_ = is_shutting_down; |
470 } | 478 } |
471 | 479 |
472 /////////////////////////////////////////////////////////////////////////////// | 480 /////////////////////////////////////////////////////////////////////////////// |
473 | 481 |
474 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 482 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
475 TestingBrowserProcess::CreateInstance(); | 483 TestingBrowserProcess::CreateInstance(); |
476 } | 484 } |
477 | 485 |
478 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 486 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
479 TestingBrowserProcess::DeleteInstance(); | 487 TestingBrowserProcess::DeleteInstance(); |
480 } | 488 } |
OLD | NEW |