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

Side by Side Diff: chromeos/dbus/mock_dbus_thread_manager.cc

Issue 12605008: D-Bus Clients for BlueZ 5 API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mock dbus thread manager without gmock? I didn't even know that was a thing! Created 7 years, 9 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
OLDNEW
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 "chromeos/dbus/mock_dbus_thread_manager.h" 5 #include "chromeos/dbus/mock_dbus_thread_manager.h"
6 6
7 #include "chromeos/dbus/dbus_thread_manager_observer.h" 7 #include "chromeos/dbus/dbus_thread_manager_observer.h"
8 #include "chromeos/dbus/mock_bluetooth_adapter_client.h" 8 #include "chromeos/dbus/mock_bluetooth_adapter_client.h"
9 #include "chromeos/dbus/mock_bluetooth_device_client.h" 9 #include "chromeos/dbus/mock_bluetooth_device_client.h"
10 #include "chromeos/dbus/mock_bluetooth_input_client.h" 10 #include "chromeos/dbus/mock_bluetooth_input_client.h"
11 #include "chromeos/dbus/mock_bluetooth_manager_client.h" 11 #include "chromeos/dbus/mock_bluetooth_manager_client.h"
12 #include "chromeos/dbus/mock_bluetooth_node_client.h" 12 #include "chromeos/dbus/mock_bluetooth_node_client.h"
13 #include "chromeos/dbus/mock_bluetooth_out_of_band_client.h" 13 #include "chromeos/dbus/mock_bluetooth_out_of_band_client.h"
14 #include "chromeos/dbus/mock_cros_disks_client.h" 14 #include "chromeos/dbus/mock_cros_disks_client.h"
15 #include "chromeos/dbus/mock_cryptohome_client.h" 15 #include "chromeos/dbus/mock_cryptohome_client.h"
16 #include "chromeos/dbus/mock_debug_daemon_client.h" 16 #include "chromeos/dbus/mock_debug_daemon_client.h"
17 #include "chromeos/dbus/mock_experimental_bluetooth_adapter_client.h"
18 #include "chromeos/dbus/mock_experimental_bluetooth_agent_manager_client.h"
19 #include "chromeos/dbus/mock_experimental_bluetooth_device_client.h"
20 #include "chromeos/dbus/mock_experimental_bluetooth_profile_manager_client.h"
17 #include "chromeos/dbus/mock_shill_device_client.h" 21 #include "chromeos/dbus/mock_shill_device_client.h"
18 #include "chromeos/dbus/mock_shill_ipconfig_client.h" 22 #include "chromeos/dbus/mock_shill_ipconfig_client.h"
19 #include "chromeos/dbus/mock_shill_manager_client.h" 23 #include "chromeos/dbus/mock_shill_manager_client.h"
20 #include "chromeos/dbus/mock_shill_profile_client.h" 24 #include "chromeos/dbus/mock_shill_profile_client.h"
21 #include "chromeos/dbus/mock_shill_service_client.h" 25 #include "chromeos/dbus/mock_shill_service_client.h"
22 #include "chromeos/dbus/mock_gsm_sms_client.h" 26 #include "chromeos/dbus/mock_gsm_sms_client.h"
23 #include "chromeos/dbus/mock_image_burner_client.h" 27 #include "chromeos/dbus/mock_image_burner_client.h"
24 #include "chromeos/dbus/mock_introspectable_client.h" 28 #include "chromeos/dbus/mock_introspectable_client.h"
25 #include "chromeos/dbus/mock_modem_messaging_client.h" 29 #include "chromeos/dbus/mock_modem_messaging_client.h"
26 #include "chromeos/dbus/mock_permission_broker_client.h" 30 #include "chromeos/dbus/mock_permission_broker_client.h"
(...skipping 14 matching lines...) Expand all
41 MockDBusThreadManager::MockDBusThreadManager() 45 MockDBusThreadManager::MockDBusThreadManager()
42 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), 46 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient),
43 mock_bluetooth_device_client_(new MockBluetoothDeviceClient), 47 mock_bluetooth_device_client_(new MockBluetoothDeviceClient),
44 mock_bluetooth_input_client_(new MockBluetoothInputClient), 48 mock_bluetooth_input_client_(new MockBluetoothInputClient),
45 mock_bluetooth_manager_client_(new MockBluetoothManagerClient), 49 mock_bluetooth_manager_client_(new MockBluetoothManagerClient),
46 mock_bluetooth_node_client_(new MockBluetoothNodeClient), 50 mock_bluetooth_node_client_(new MockBluetoothNodeClient),
47 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient), 51 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient),
48 mock_cros_disks_client_(new MockCrosDisksClient), 52 mock_cros_disks_client_(new MockCrosDisksClient),
49 mock_cryptohome_client_(new MockCryptohomeClient), 53 mock_cryptohome_client_(new MockCryptohomeClient),
50 mock_debugdaemon_client_(new MockDebugDaemonClient), 54 mock_debugdaemon_client_(new MockDebugDaemonClient),
55 mock_experimental_bluetooth_adapter_client_(
56 new MockExperimentalBluetoothAdapterClient),
57 mock_experimental_bluetooth_agent_manager_client_(
58 new MockExperimentalBluetoothAgentManagerClient),
59 mock_experimental_bluetooth_device_client_(
60 new MockExperimentalBluetoothDeviceClient),
61 mock_experimental_bluetooth_profile_manager_client_(
62 new MockExperimentalBluetoothProfileManagerClient),
51 mock_shill_device_client_(new MockShillDeviceClient), 63 mock_shill_device_client_(new MockShillDeviceClient),
52 mock_shill_ipconfig_client_(new MockShillIPConfigClient), 64 mock_shill_ipconfig_client_(new MockShillIPConfigClient),
53 mock_shill_manager_client_(new MockShillManagerClient), 65 mock_shill_manager_client_(new MockShillManagerClient),
54 mock_shill_profile_client_(new MockShillProfileClient), 66 mock_shill_profile_client_(new MockShillProfileClient),
55 mock_shill_service_client_(new MockShillServiceClient), 67 mock_shill_service_client_(new MockShillServiceClient),
56 mock_gsm_sms_client_(new MockGsmSMSClient), 68 mock_gsm_sms_client_(new MockGsmSMSClient),
57 mock_image_burner_client_(new MockImageBurnerClient), 69 mock_image_burner_client_(new MockImageBurnerClient),
58 mock_introspectable_client_(new MockIntrospectableClient), 70 mock_introspectable_client_(new MockIntrospectableClient),
59 mock_modem_messaging_client_(new MockModemMessagingClient), 71 mock_modem_messaging_client_(new MockModemMessagingClient),
60 mock_permission_broker_client_(new MockPermissionBrokerClient), 72 mock_permission_broker_client_(new MockPermissionBrokerClient),
(...skipping 13 matching lines...) Expand all
74 EXPECT_CALL(*this, GetBluetoothNodeClient()) 86 EXPECT_CALL(*this, GetBluetoothNodeClient())
75 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); 87 .WillRepeatedly(Return(mock_bluetooth_node_client_.get()));
76 EXPECT_CALL(*this, GetBluetoothOutOfBandClient()) 88 EXPECT_CALL(*this, GetBluetoothOutOfBandClient())
77 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get())); 89 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get()));
78 EXPECT_CALL(*this, GetCrosDisksClient()) 90 EXPECT_CALL(*this, GetCrosDisksClient())
79 .WillRepeatedly(Return(mock_cros_disks_client())); 91 .WillRepeatedly(Return(mock_cros_disks_client()));
80 EXPECT_CALL(*this, GetCryptohomeClient()) 92 EXPECT_CALL(*this, GetCryptohomeClient())
81 .WillRepeatedly(Return(mock_cryptohome_client())); 93 .WillRepeatedly(Return(mock_cryptohome_client()));
82 EXPECT_CALL(*this, GetDebugDaemonClient()) 94 EXPECT_CALL(*this, GetDebugDaemonClient())
83 .WillRepeatedly(Return(mock_debugdaemon_client())); 95 .WillRepeatedly(Return(mock_debugdaemon_client()));
96 EXPECT_CALL(*this, GetExperimentalBluetoothAdapterClient())
97 .WillRepeatedly(Return(mock_experimental_bluetooth_adapter_client()));
98 EXPECT_CALL(*this, GetExperimentalBluetoothAgentManagerClient())
99 .WillRepeatedly(Return(
100 mock_experimental_bluetooth_agent_manager_client()));
101 EXPECT_CALL(*this, GetExperimentalBluetoothDeviceClient())
102 .WillRepeatedly(Return(mock_experimental_bluetooth_device_client()));
103 EXPECT_CALL(*this, GetExperimentalBluetoothProfileManagerClient())
104 .WillRepeatedly(Return(
105 mock_experimental_bluetooth_profile_manager_client()));
84 EXPECT_CALL(*this, GetShillDeviceClient()) 106 EXPECT_CALL(*this, GetShillDeviceClient())
85 .WillRepeatedly(Return(mock_shill_device_client())); 107 .WillRepeatedly(Return(mock_shill_device_client()));
86 EXPECT_CALL(*this, GetShillIPConfigClient()) 108 EXPECT_CALL(*this, GetShillIPConfigClient())
87 .WillRepeatedly(Return(mock_shill_ipconfig_client())); 109 .WillRepeatedly(Return(mock_shill_ipconfig_client()));
88 EXPECT_CALL(*this, GetShillManagerClient()) 110 EXPECT_CALL(*this, GetShillManagerClient())
89 .WillRepeatedly(Return(mock_shill_manager_client())); 111 .WillRepeatedly(Return(mock_shill_manager_client()));
90 EXPECT_CALL(*this, GetShillProfileClient()) 112 EXPECT_CALL(*this, GetShillProfileClient())
91 .WillRepeatedly(Return(mock_shill_profile_client())); 113 .WillRepeatedly(Return(mock_shill_profile_client()));
92 EXPECT_CALL(*this, GetShillServiceClient()) 114 EXPECT_CALL(*this, GetShillServiceClient())
93 .WillRepeatedly(Return(mock_shill_service_client())); 115 .WillRepeatedly(Return(mock_shill_service_client()));
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 EXPECT_CALL(*mock_bluetooth_device_client_.get(), RemoveObserver(_)) 188 EXPECT_CALL(*mock_bluetooth_device_client_.get(), RemoveObserver(_))
167 .Times(AnyNumber()); 189 .Times(AnyNumber());
168 EXPECT_CALL(*mock_bluetooth_input_client_.get(), AddObserver(_)) 190 EXPECT_CALL(*mock_bluetooth_input_client_.get(), AddObserver(_))
169 .Times(AnyNumber()); 191 .Times(AnyNumber());
170 EXPECT_CALL(*mock_bluetooth_input_client_.get(), RemoveObserver(_)) 192 EXPECT_CALL(*mock_bluetooth_input_client_.get(), RemoveObserver(_))
171 .Times(AnyNumber()); 193 .Times(AnyNumber());
172 EXPECT_CALL(*mock_bluetooth_node_client_.get(), AddObserver(_)) 194 EXPECT_CALL(*mock_bluetooth_node_client_.get(), AddObserver(_))
173 .Times(AnyNumber()); 195 .Times(AnyNumber());
174 EXPECT_CALL(*mock_bluetooth_node_client_.get(), RemoveObserver(_)) 196 EXPECT_CALL(*mock_bluetooth_node_client_.get(), RemoveObserver(_))
175 .Times(AnyNumber()); 197 .Times(AnyNumber());
198 EXPECT_CALL(*mock_experimental_bluetooth_adapter_client_.get(),
199 AddObserver(_))
200 .Times(AnyNumber());
201 EXPECT_CALL(*mock_experimental_bluetooth_adapter_client_.get(),
202 RemoveObserver(_))
203 .Times(AnyNumber());
204 EXPECT_CALL(*mock_experimental_bluetooth_device_client_.get(),
205 AddObserver(_))
206 .Times(AnyNumber());
207 EXPECT_CALL(*mock_experimental_bluetooth_device_client_.get(),
208 RemoveObserver(_))
209 .Times(AnyNumber());
176 210
177 // Called from PowerMenuButton ctor. 211 // Called from PowerMenuButton ctor.
178 EXPECT_CALL(*mock_power_manager_client_.get(), RequestStatusUpdate(_)) 212 EXPECT_CALL(*mock_power_manager_client_.get(), RequestStatusUpdate(_))
179 .Times(AnyNumber()); 213 .Times(AnyNumber());
180 214
181 // Called from DiskMountManager::Initialize(), ChromeBrowserMainPartsChromeos. 215 // Called from DiskMountManager::Initialize(), ChromeBrowserMainPartsChromeos.
182 EXPECT_CALL(*mock_cros_disks_client_.get(), SetUpConnections(_, _)) 216 EXPECT_CALL(*mock_cros_disks_client_.get(), SetUpConnections(_, _))
183 .Times(AnyNumber()); 217 .Times(AnyNumber());
184 EXPECT_CALL(*mock_cros_disks_client_.get(), 218 EXPECT_CALL(*mock_cros_disks_client_.get(),
185 EnumerateAutoMountableDevices(_, _)) 219 EnumerateAutoMountableDevices(_, _))
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 observers_.AddObserver(observer); 254 observers_.AddObserver(observer);
221 } 255 }
222 256
223 void MockDBusThreadManager::RemoveObserver( 257 void MockDBusThreadManager::RemoveObserver(
224 DBusThreadManagerObserver* observer) { 258 DBusThreadManagerObserver* observer) {
225 DCHECK(observer); 259 DCHECK(observer);
226 observers_.RemoveObserver(observer); 260 observers_.RemoveObserver(observer);
227 } 261 }
228 262
229 } // namespace chromeos 263 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager.h ('k') | chromeos/dbus/mock_dbus_thread_manager_without_gmock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698