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 "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" |
(...skipping 11 matching lines...) Expand all Loading... | |
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_speech_synthesizer_client.h" | 30 #include "chromeos/dbus/mock_speech_synthesizer_client.h" |
31 #include "chromeos/dbus/mock_update_engine_client.h" | 31 #include "chromeos/dbus/mock_update_engine_client.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 |
40 MockDBusThreadManager::MockDBusThreadManager() | 41 MockDBusThreadManager::MockDBusThreadManager() |
41 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), | 42 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), |
(...skipping 12 matching lines...) Expand all Loading... | |
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), |
63 mock_speech_synthesizer_client_(new MockSpeechSynthesizerClient), | 64 mock_speech_synthesizer_client_(new MockSpeechSynthesizerClient), |
64 mock_update_engine_client_(new MockUpdateEngineClient) { | 65 mock_update_engine_client_(new MockUpdateEngineClient), |
66 power_policy_controller_( | |
bartfab (slow)
2013/02/04 10:04:35
I haven't looked at what gets mock here in detail
Daniel Erat
2013/02/04 13:35:45
Yes.
| |
67 new PowerPolicyController(mock_power_manager_client_.get())) { | |
65 EXPECT_CALL(*this, GetBluetoothAdapterClient()) | 68 EXPECT_CALL(*this, GetBluetoothAdapterClient()) |
66 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get())); | 69 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get())); |
67 EXPECT_CALL(*this, GetBluetoothDeviceClient()) | 70 EXPECT_CALL(*this, GetBluetoothDeviceClient()) |
68 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); | 71 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); |
69 EXPECT_CALL(*this, GetBluetoothInputClient()) | 72 EXPECT_CALL(*this, GetBluetoothInputClient()) |
70 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); | 73 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); |
71 EXPECT_CALL(*this, GetBluetoothManagerClient()) | 74 EXPECT_CALL(*this, GetBluetoothManagerClient()) |
72 .WillRepeatedly(Return(mock_bluetooth_manager_client())); | 75 .WillRepeatedly(Return(mock_bluetooth_manager_client())); |
73 EXPECT_CALL(*this, GetBluetoothNodeClient()) | 76 EXPECT_CALL(*this, GetBluetoothNodeClient()) |
74 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); | 77 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); |
(...skipping 18 matching lines...) Expand all Loading... | |
93 EXPECT_CALL(*this, GetGsmSMSClient()) | 96 EXPECT_CALL(*this, GetGsmSMSClient()) |
94 .WillRepeatedly(Return(mock_gsm_sms_client())); | 97 .WillRepeatedly(Return(mock_gsm_sms_client())); |
95 EXPECT_CALL(*this, GetImageBurnerClient()) | 98 EXPECT_CALL(*this, GetImageBurnerClient()) |
96 .WillRepeatedly(Return(mock_image_burner_client())); | 99 .WillRepeatedly(Return(mock_image_burner_client())); |
97 EXPECT_CALL(*this, GetIntrospectableClient()) | 100 EXPECT_CALL(*this, GetIntrospectableClient()) |
98 .WillRepeatedly(Return(mock_introspectable_client())); | 101 .WillRepeatedly(Return(mock_introspectable_client())); |
99 EXPECT_CALL(*this, GetModemMessagingClient()) | 102 EXPECT_CALL(*this, GetModemMessagingClient()) |
100 .WillRepeatedly(Return(mock_modem_messaging_client())); | 103 .WillRepeatedly(Return(mock_modem_messaging_client())); |
101 EXPECT_CALL(*this, GetPowerManagerClient()) | 104 EXPECT_CALL(*this, GetPowerManagerClient()) |
102 .WillRepeatedly(Return(mock_power_manager_client_.get())); | 105 .WillRepeatedly(Return(mock_power_manager_client_.get())); |
106 EXPECT_CALL(*this, GetPowerPolicyController()) | |
107 .WillRepeatedly(Return(power_policy_controller_.get())); | |
103 EXPECT_CALL(*this, GetSessionManagerClient()) | 108 EXPECT_CALL(*this, GetSessionManagerClient()) |
104 .WillRepeatedly(Return(mock_session_manager_client_.get())); | 109 .WillRepeatedly(Return(mock_session_manager_client_.get())); |
105 EXPECT_CALL(*this, GetSMSClient()) | 110 EXPECT_CALL(*this, GetSMSClient()) |
106 .WillRepeatedly(Return(mock_sms_client_.get())); | 111 .WillRepeatedly(Return(mock_sms_client_.get())); |
107 EXPECT_CALL(*this, GetSpeechSynthesizerClient()) | 112 EXPECT_CALL(*this, GetSpeechSynthesizerClient()) |
108 .WillRepeatedly(Return(mock_speech_synthesizer_client_.get())); | 113 .WillRepeatedly(Return(mock_speech_synthesizer_client_.get())); |
109 EXPECT_CALL(*this, GetUpdateEngineClient()) | 114 EXPECT_CALL(*this, GetUpdateEngineClient()) |
110 .WillRepeatedly(Return(mock_update_engine_client_.get())); | 115 .WillRepeatedly(Return(mock_update_engine_client_.get())); |
111 | 116 |
112 EXPECT_CALL(*this, GetIBusBus()) | 117 EXPECT_CALL(*this, GetIBusBus()) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 observers_.AddObserver(observer); | 185 observers_.AddObserver(observer); |
181 } | 186 } |
182 | 187 |
183 void MockDBusThreadManager::RemoveObserver( | 188 void MockDBusThreadManager::RemoveObserver( |
184 DBusThreadManagerObserver* observer) { | 189 DBusThreadManagerObserver* observer) { |
185 DCHECK(observer); | 190 DCHECK(observer); |
186 observers_.RemoveObserver(observer); | 191 observers_.RemoveObserver(observer); |
187 } | 192 } |
188 | 193 |
189 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |