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

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

Issue 12564007: Hook up system clock update dbus signal to chrome and ash tray ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests by adding MockSystemClockClient. 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_shill_device_client.h" 17 #include "chromeos/dbus/mock_shill_device_client.h"
18 #include "chromeos/dbus/mock_shill_ipconfig_client.h" 18 #include "chromeos/dbus/mock_shill_ipconfig_client.h"
19 #include "chromeos/dbus/mock_shill_manager_client.h" 19 #include "chromeos/dbus/mock_shill_manager_client.h"
20 #include "chromeos/dbus/mock_shill_profile_client.h" 20 #include "chromeos/dbus/mock_shill_profile_client.h"
21 #include "chromeos/dbus/mock_shill_service_client.h" 21 #include "chromeos/dbus/mock_shill_service_client.h"
22 #include "chromeos/dbus/mock_gsm_sms_client.h" 22 #include "chromeos/dbus/mock_gsm_sms_client.h"
23 #include "chromeos/dbus/mock_image_burner_client.h" 23 #include "chromeos/dbus/mock_image_burner_client.h"
24 #include "chromeos/dbus/mock_introspectable_client.h" 24 #include "chromeos/dbus/mock_introspectable_client.h"
25 #include "chromeos/dbus/mock_modem_messaging_client.h" 25 #include "chromeos/dbus/mock_modem_messaging_client.h"
26 #include "chromeos/dbus/mock_permission_broker_client.h" 26 #include "chromeos/dbus/mock_permission_broker_client.h"
27 #include "chromeos/dbus/mock_power_manager_client.h" 27 #include "chromeos/dbus/mock_power_manager_client.h"
28 #include "chromeos/dbus/mock_session_manager_client.h" 28 #include "chromeos/dbus/mock_session_manager_client.h"
29 #include "chromeos/dbus/mock_sms_client.h" 29 #include "chromeos/dbus/mock_sms_client.h"
30 #include "chromeos/dbus/mock_system_clock_client.h"
30 #include "chromeos/dbus/mock_update_engine_client.h" 31 #include "chromeos/dbus/mock_update_engine_client.h"
31 #include "chromeos/dbus/power_policy_controller.h" 32 #include "chromeos/dbus/power_policy_controller.h"
32 33
33 using ::testing::AnyNumber; 34 using ::testing::AnyNumber;
34 using ::testing::Return; 35 using ::testing::Return;
35 using ::testing::ReturnNull; 36 using ::testing::ReturnNull;
36 using ::testing::_; 37 using ::testing::_;
37 38
38 namespace chromeos { 39 namespace chromeos {
39 40
(...skipping 13 matching lines...) Expand all
53 mock_shill_profile_client_(new MockShillProfileClient), 54 mock_shill_profile_client_(new MockShillProfileClient),
54 mock_shill_service_client_(new MockShillServiceClient), 55 mock_shill_service_client_(new MockShillServiceClient),
55 mock_gsm_sms_client_(new MockGsmSMSClient), 56 mock_gsm_sms_client_(new MockGsmSMSClient),
56 mock_image_burner_client_(new MockImageBurnerClient), 57 mock_image_burner_client_(new MockImageBurnerClient),
57 mock_introspectable_client_(new MockIntrospectableClient), 58 mock_introspectable_client_(new MockIntrospectableClient),
58 mock_modem_messaging_client_(new MockModemMessagingClient), 59 mock_modem_messaging_client_(new MockModemMessagingClient),
59 mock_permission_broker_client_(new MockPermissionBrokerClient), 60 mock_permission_broker_client_(new MockPermissionBrokerClient),
60 mock_power_manager_client_(new MockPowerManagerClient), 61 mock_power_manager_client_(new MockPowerManagerClient),
61 mock_session_manager_client_(new MockSessionManagerClient), 62 mock_session_manager_client_(new MockSessionManagerClient),
62 mock_sms_client_(new MockSMSClient), 63 mock_sms_client_(new MockSMSClient),
64 mock_system_clock_client_(new MockSystemClockClient),
63 mock_update_engine_client_(new MockUpdateEngineClient) { 65 mock_update_engine_client_(new MockUpdateEngineClient) {
64 EXPECT_CALL(*this, GetBluetoothAdapterClient()) 66 EXPECT_CALL(*this, GetBluetoothAdapterClient())
65 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get())); 67 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get()));
66 EXPECT_CALL(*this, GetBluetoothDeviceClient()) 68 EXPECT_CALL(*this, GetBluetoothDeviceClient())
67 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); 69 .WillRepeatedly(Return(mock_bluetooth_device_client_.get()));
68 EXPECT_CALL(*this, GetBluetoothInputClient()) 70 EXPECT_CALL(*this, GetBluetoothInputClient())
69 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); 71 .WillRepeatedly(Return(mock_bluetooth_input_client_.get()));
70 EXPECT_CALL(*this, GetBluetoothManagerClient()) 72 EXPECT_CALL(*this, GetBluetoothManagerClient())
71 .WillRepeatedly(Return(mock_bluetooth_manager_client())); 73 .WillRepeatedly(Return(mock_bluetooth_manager_client()));
72 EXPECT_CALL(*this, GetBluetoothNodeClient()) 74 EXPECT_CALL(*this, GetBluetoothNodeClient())
(...skipping 23 matching lines...) Expand all
96 EXPECT_CALL(*this, GetIntrospectableClient()) 98 EXPECT_CALL(*this, GetIntrospectableClient())
97 .WillRepeatedly(Return(mock_introspectable_client())); 99 .WillRepeatedly(Return(mock_introspectable_client()));
98 EXPECT_CALL(*this, GetModemMessagingClient()) 100 EXPECT_CALL(*this, GetModemMessagingClient())
99 .WillRepeatedly(Return(mock_modem_messaging_client())); 101 .WillRepeatedly(Return(mock_modem_messaging_client()));
100 EXPECT_CALL(*this, GetPowerManagerClient()) 102 EXPECT_CALL(*this, GetPowerManagerClient())
101 .WillRepeatedly(Return(mock_power_manager_client_.get())); 103 .WillRepeatedly(Return(mock_power_manager_client_.get()));
102 EXPECT_CALL(*this, GetSessionManagerClient()) 104 EXPECT_CALL(*this, GetSessionManagerClient())
103 .WillRepeatedly(Return(mock_session_manager_client_.get())); 105 .WillRepeatedly(Return(mock_session_manager_client_.get()));
104 EXPECT_CALL(*this, GetSMSClient()) 106 EXPECT_CALL(*this, GetSMSClient())
105 .WillRepeatedly(Return(mock_sms_client_.get())); 107 .WillRepeatedly(Return(mock_sms_client_.get()));
108 EXPECT_CALL(*this, GetSystemClockClient())
109 .WillRepeatedly(Return(mock_system_clock_client()));
106 EXPECT_CALL(*this, GetUpdateEngineClient()) 110 EXPECT_CALL(*this, GetUpdateEngineClient())
107 .WillRepeatedly(Return(mock_update_engine_client_.get())); 111 .WillRepeatedly(Return(mock_update_engine_client_.get()));
108 EXPECT_CALL(*this, GetIBusInputContextClient()) 112 EXPECT_CALL(*this, GetIBusInputContextClient())
109 .WillRepeatedly(ReturnNull()); 113 .WillRepeatedly(ReturnNull());
110 EXPECT_CALL(*this, GetIBusConfigClient()) 114 EXPECT_CALL(*this, GetIBusConfigClient())
111 .WillRepeatedly(ReturnNull()); 115 .WillRepeatedly(ReturnNull());
112 116
113 EXPECT_CALL(*this, GetSystemBus()) 117 EXPECT_CALL(*this, GetSystemBus())
114 .WillRepeatedly(ReturnNull()); 118 .WillRepeatedly(ReturnNull());
115 EXPECT_CALL(*this, GetIBusBus()) 119 EXPECT_CALL(*this, GetIBusBus())
(...skipping 18 matching lines...) Expand all
134 138
135 // These observers calls are used in ChromeBrowserMainPartsChromeos. 139 // These observers calls are used in ChromeBrowserMainPartsChromeos.
136 EXPECT_CALL(*mock_session_manager_client_.get(), AddObserver(_)) 140 EXPECT_CALL(*mock_session_manager_client_.get(), AddObserver(_))
137 .Times(AnyNumber()); 141 .Times(AnyNumber());
138 EXPECT_CALL(*mock_session_manager_client_.get(), RemoveObserver(_)) 142 EXPECT_CALL(*mock_session_manager_client_.get(), RemoveObserver(_))
139 .Times(AnyNumber()); 143 .Times(AnyNumber());
140 EXPECT_CALL(*mock_session_manager_client_.get(), HasObserver(_)) 144 EXPECT_CALL(*mock_session_manager_client_.get(), HasObserver(_))
141 .Times(AnyNumber()); 145 .Times(AnyNumber());
142 EXPECT_CALL(*mock_update_engine_client_.get(), AddObserver(_)) 146 EXPECT_CALL(*mock_update_engine_client_.get(), AddObserver(_))
143 .Times(AnyNumber()); 147 .Times(AnyNumber());
148 EXPECT_CALL(*mock_system_clock_client_.get(), AddObserver(_))
149 .Times(AnyNumber());
150 EXPECT_CALL(*mock_system_clock_client_.get(), RemoveObserver(_))
151 .Times(AnyNumber());
152 EXPECT_CALL(*mock_system_clock_client_.get(), HasObserver(_))
153 .Times(AnyNumber());
144 EXPECT_CALL(*mock_update_engine_client_.get(), RemoveObserver(_)) 154 EXPECT_CALL(*mock_update_engine_client_.get(), RemoveObserver(_))
145 .Times(AnyNumber()); 155 .Times(AnyNumber());
146 EXPECT_CALL(*mock_bluetooth_manager_client_.get(), AddObserver(_)) 156 EXPECT_CALL(*mock_bluetooth_manager_client_.get(), AddObserver(_))
147 .Times(AnyNumber()); 157 .Times(AnyNumber());
148 EXPECT_CALL(*mock_bluetooth_manager_client_.get(), RemoveObserver(_)) 158 EXPECT_CALL(*mock_bluetooth_manager_client_.get(), RemoveObserver(_))
149 .Times(AnyNumber()); 159 .Times(AnyNumber());
150 EXPECT_CALL(*mock_bluetooth_adapter_client_.get(), AddObserver(_)) 160 EXPECT_CALL(*mock_bluetooth_adapter_client_.get(), AddObserver(_))
151 .Times(AnyNumber()); 161 .Times(AnyNumber());
152 EXPECT_CALL(*mock_bluetooth_adapter_client_.get(), RemoveObserver(_)) 162 EXPECT_CALL(*mock_bluetooth_adapter_client_.get(), RemoveObserver(_))
153 .Times(AnyNumber()); 163 .Times(AnyNumber());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 observers_.AddObserver(observer); 220 observers_.AddObserver(observer);
211 } 221 }
212 222
213 void MockDBusThreadManager::RemoveObserver( 223 void MockDBusThreadManager::RemoveObserver(
214 DBusThreadManagerObserver* observer) { 224 DBusThreadManagerObserver* observer) {
215 DCHECK(observer); 225 DCHECK(observer);
216 observers_.RemoveObserver(observer); 226 observers_.RemoveObserver(observer);
217 } 227 }
218 228
219 } // namespace chromeos 229 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698