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

Side by Side Diff: ash/test/ash_test_helper.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ash/wm/lock_state_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/test/ash_test_helper.h" 5 #include "ash/test/ash_test_helper.h"
6 6
7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/dbus_thread_manager_ash.h"
9 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/test/material_design_controller_test_api.h" 11 #include "ash/common/test/material_design_controller_test_api.h"
11 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
12 #include "ash/shell.h" 13 #include "ash/shell.h"
13 #include "ash/shell_init_params.h" 14 #include "ash/shell_init_params.h"
14 #include "ash/test/ash_test_environment.h" 15 #include "ash/test/ash_test_environment.h"
15 #include "ash/test/ash_test_views_delegate.h" 16 #include "ash/test/ash_test_views_delegate.h"
16 #include "ash/test/display_manager_test_api.h" 17 #include "ash/test/display_manager_test_api.h"
17 #include "ash/test/shell_test_api.h" 18 #include "ash/test/shell_test_api.h"
18 #include "ash/test/test_screenshot_delegate.h" 19 #include "ash/test/test_screenshot_delegate.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 test_shell_delegate_ = new TestShellDelegate; 88 test_shell_delegate_ = new TestShellDelegate;
88 89
89 // Creates MessageCenter since g_browser_process is not created in AshTestBase 90 // Creates MessageCenter since g_browser_process is not created in AshTestBase
90 // tests. 91 // tests.
91 message_center::MessageCenter::Initialize(); 92 message_center::MessageCenter::Initialize();
92 93
93 #if defined(OS_CHROMEOS) 94 #if defined(OS_CHROMEOS)
94 // Create DBusThreadManager for testing. 95 // Create DBusThreadManager for testing.
95 if (!chromeos::DBusThreadManager::IsInitialized()) { 96 if (!chromeos::DBusThreadManager::IsInitialized()) {
96 chromeos::DBusThreadManager::Initialize(); 97 chromeos::DBusThreadManager::Initialize();
98 //JAMES leak
99 new DBusThreadManagerAsh();
97 dbus_thread_manager_initialized_ = true; 100 dbus_thread_manager_initialized_ = true;
98 } 101 }
99 102
100 if (!bluez::BluezDBusManager::IsInitialized()) { 103 if (!bluez::BluezDBusManager::IsInitialized()) {
101 bluez::BluezDBusManager::Initialize( 104 bluez::BluezDBusManager::Initialize(
102 chromeos::DBusThreadManager::Get()->GetSystemBus(), 105 chromeos::DBusThreadManager::Get()->GetSystemBus(),
103 chromeos::DBusThreadManager::Get()->IsUsingStub( 106 chromeos::DBusThreadManager::Get()->IsUsingFake(
104 chromeos::DBusClientBundle::BLUETOOTH)); 107 chromeos::DBusClientBundle::BLUETOOTH));
105 bluez_dbus_manager_initialized_ = true; 108 bluez_dbus_manager_initialized_ = true;
106 } 109 }
107 110
108 // Create CrasAudioHandler for testing since g_browser_process is not 111 // Create CrasAudioHandler for testing since g_browser_process is not
109 // created in AshTestBase tests. 112 // created in AshTestBase tests.
110 chromeos::CrasAudioHandler::InitializeForTesting(); 113 chromeos::CrasAudioHandler::InitializeForTesting();
111 #endif 114 #endif
112 ash_test_environment_->SetUp(); 115 ash_test_environment_->SetUp();
113 // Reset the global state for the cursor manager. This includes the 116 // Reset the global state for the cursor manager. This includes the
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool AshTestHelper::SupportsHostWindowResize() { 221 bool AshTestHelper::SupportsHostWindowResize() {
219 #if defined(OS_WIN) 222 #if defined(OS_WIN)
220 return false; 223 return false;
221 #else 224 #else
222 return true; 225 return true;
223 #endif 226 #endif
224 } 227 }
225 228
226 } // namespace test 229 } // namespace test
227 } // namespace ash 230 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ash/wm/lock_state_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698