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_without_gmock.h" | 5 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.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/fake_bluetooth_adapter_client.h" | 8 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
9 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | 9 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
10 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 10 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
11 #include "chromeos/dbus/fake_bluetooth_input_client.h" | 11 #include "chromeos/dbus/fake_bluetooth_input_client.h" |
12 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" | 12 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" |
13 #include "chromeos/dbus/fake_cros_disks_client.h" | 13 #include "chromeos/dbus/fake_cros_disks_client.h" |
14 #include "chromeos/dbus/fake_shill_manager_client.h" | 14 #include "chromeos/dbus/fake_shill_manager_client.h" |
15 #include "chromeos/dbus/ibus/mock_ibus_client.h" | 15 #include "chromeos/dbus/ibus/mock_ibus_client.h" |
16 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" | 16 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" |
17 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" | 17 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" |
18 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" | 18 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" |
19 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" | 19 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" |
20 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" | 20 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" |
21 #include "dbus/fake_bus.h" | |
22 | 21 |
23 namespace chromeos { | 22 namespace chromeos { |
24 | 23 |
25 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() | 24 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() |
26 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), | 25 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), |
27 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), | 26 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), |
28 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), | 27 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), |
29 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), | 28 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), |
30 fake_bluetooth_profile_manager_client_( | 29 fake_bluetooth_profile_manager_client_( |
31 new FakeBluetoothProfileManagerClient()), | 30 new FakeBluetoothProfileManagerClient()), |
(...skipping 21 matching lines...) Expand all Loading... |
53 | 52 |
54 void MockDBusThreadManagerWithoutGMock::RemoveObserver( | 53 void MockDBusThreadManagerWithoutGMock::RemoveObserver( |
55 DBusThreadManagerObserver* observer) { | 54 DBusThreadManagerObserver* observer) { |
56 DCHECK(observer); | 55 DCHECK(observer); |
57 observers_.RemoveObserver(observer); | 56 observers_.RemoveObserver(observer); |
58 } | 57 } |
59 | 58 |
60 void MockDBusThreadManagerWithoutGMock::InitIBusBus( | 59 void MockDBusThreadManagerWithoutGMock::InitIBusBus( |
61 const std::string& ibus_address, | 60 const std::string& ibus_address, |
62 const base::Closure& closure) { | 61 const base::Closure& closure) { |
63 dbus::Bus::Options options; | 62 // Non-null bus address is used to ensure the connection to ibus-daemon. |
64 ibus_bus_ = new dbus::FakeBus(options); | 63 ibus_bus_ = reinterpret_cast<dbus::Bus*>(0xdeadbeef); |
65 } | 64 } |
66 | 65 |
67 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() { | 66 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() { |
68 return NULL; | 67 return NULL; |
69 } | 68 } |
70 | 69 |
71 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { | 70 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { |
72 return ibus_bus_; | 71 return ibus_bus_; |
73 } | 72 } |
74 | 73 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 267 |
269 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( | 268 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( |
270 const dbus::ObjectPath& object_path) { | 269 const dbus::ObjectPath& object_path) { |
271 } | 270 } |
272 | 271 |
273 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { | 272 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { |
274 return mock_ibus_panel_service_.get(); | 273 return mock_ibus_panel_service_.get(); |
275 } | 274 } |
276 | 275 |
277 } // namespace chromeos | 276 } // namespace chromeos |
OLD | NEW |