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/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/time/default_clock.h" | 8 #include "base/time/default_clock.h" |
9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 TestingBrowserProcess::TestingBrowserProcess() | 69 TestingBrowserProcess::TestingBrowserProcess() |
70 : notification_service_(content::NotificationService::Create()), | 70 : notification_service_(content::NotificationService::Create()), |
71 app_locale_("en"), | 71 app_locale_("en"), |
72 is_shutting_down_(false), | 72 is_shutting_down_(false), |
73 local_state_(nullptr), | 73 local_state_(nullptr), |
74 io_thread_(nullptr), | 74 io_thread_(nullptr), |
75 system_request_context_(nullptr), | 75 system_request_context_(nullptr), |
76 rappor_service_(nullptr), | 76 rappor_service_(nullptr), |
77 platform_part_(new TestingBrowserProcessPlatformPart()) { | 77 platform_part_(new TestingBrowserProcessPlatformPart()) { |
| 78 message_center::MessageCenter::Initialize(); |
78 #if BUILDFLAG(ENABLE_EXTENSIONS) | 79 #if BUILDFLAG(ENABLE_EXTENSIONS) |
79 extensions_browser_client_.reset( | 80 extensions_browser_client_.reset( |
80 new extensions::ChromeExtensionsBrowserClient); | 81 new extensions::ChromeExtensionsBrowserClient); |
81 extensions::AppWindowClient::Set(ChromeAppWindowClient::GetInstance()); | 82 extensions::AppWindowClient::Set(ChromeAppWindowClient::GetInstance()); |
82 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); | 83 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
83 #endif | 84 #endif |
84 } | 85 } |
85 | 86 |
86 TestingBrowserProcess::~TestingBrowserProcess() { | 87 TestingBrowserProcess::~TestingBrowserProcess() { |
87 EXPECT_FALSE(local_state_); | 88 EXPECT_FALSE(local_state_); |
88 ShutdownBrowserPolicyConnector(); | 89 ShutdownBrowserPolicyConnector(); |
89 #if BUILDFLAG(ENABLE_EXTENSIONS) | 90 #if BUILDFLAG(ENABLE_EXTENSIONS) |
90 extensions::ExtensionsBrowserClient::Set(nullptr); | 91 extensions::ExtensionsBrowserClient::Set(nullptr); |
91 #endif | 92 #endif |
92 | 93 |
| 94 message_center::MessageCenter::Shutdown(); |
93 // Destructors for some objects owned by TestingBrowserProcess will use | 95 // Destructors for some objects owned by TestingBrowserProcess will use |
94 // g_browser_process if it is not null, so it must be null before proceeding. | 96 // g_browser_process if it is not null, so it must be null before proceeding. |
95 DCHECK_EQ(static_cast<BrowserProcess*>(nullptr), g_browser_process); | 97 DCHECK_EQ(static_cast<BrowserProcess*>(nullptr), g_browser_process); |
96 } | 98 } |
97 | 99 |
98 void TestingBrowserProcess::ResourceDispatcherHostCreated() { | 100 void TestingBrowserProcess::ResourceDispatcherHostCreated() { |
99 } | 101 } |
100 | 102 |
101 void TestingBrowserProcess::EndSession() { | 103 void TestingBrowserProcess::EndSession() { |
102 } | 104 } |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 | 457 |
456 /////////////////////////////////////////////////////////////////////////////// | 458 /////////////////////////////////////////////////////////////////////////////// |
457 | 459 |
458 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 460 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
459 TestingBrowserProcess::CreateInstance(); | 461 TestingBrowserProcess::CreateInstance(); |
460 } | 462 } |
461 | 463 |
462 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 464 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
463 TestingBrowserProcess::DeleteInstance(); | 465 TestingBrowserProcess::DeleteInstance(); |
464 } | 466 } |
OLD | NEW |