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

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

Issue 14493004: dbus: Add FakeBus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove garbage line. Created 7 years, 8 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
« no previous file with comments | « chromeos/chromeos.gyp ('k') | dbus/dbus.gyp » ('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 (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/ibus/mock_ibus_client.h" 14 #include "chromeos/dbus/ibus/mock_ibus_client.h"
15 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" 15 #include "chromeos/dbus/ibus/mock_ibus_config_client.h"
16 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" 16 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h"
17 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" 17 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h"
18 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" 18 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h"
19 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" 19 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h"
20 #include "dbus/fake_bus.h"
20 21
21 namespace chromeos { 22 namespace chromeos {
22 23
23 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() 24 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock()
24 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), 25 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()),
25 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), 26 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()),
26 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), 27 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()),
27 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), 28 fake_bluetooth_input_client_(new FakeBluetoothInputClient()),
28 fake_bluetooth_profile_manager_client_( 29 fake_bluetooth_profile_manager_client_(
29 new FakeBluetoothProfileManagerClient()), 30 new FakeBluetoothProfileManagerClient()),
(...skipping 16 matching lines...) Expand all
46 47
47 void MockDBusThreadManagerWithoutGMock::RemoveObserver( 48 void MockDBusThreadManagerWithoutGMock::RemoveObserver(
48 DBusThreadManagerObserver* observer) { 49 DBusThreadManagerObserver* observer) {
49 DCHECK(observer); 50 DCHECK(observer);
50 observers_.RemoveObserver(observer); 51 observers_.RemoveObserver(observer);
51 } 52 }
52 53
53 void MockDBusThreadManagerWithoutGMock::InitIBusBus( 54 void MockDBusThreadManagerWithoutGMock::InitIBusBus(
54 const std::string& ibus_address, 55 const std::string& ibus_address,
55 const base::Closure& closure) { 56 const base::Closure& closure) {
56 // Non-null bus address is used to ensure the connection to ibus-daemon. 57 dbus::Bus::Options options;
57 ibus_bus_ = reinterpret_cast<dbus::Bus*>(0xdeadbeef); 58 ibus_bus_ = new dbus::FakeBus(options);
58 } 59 }
59 60
60 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() { 61 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() {
61 return NULL; 62 return NULL;
62 } 63 }
63 64
64 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { 65 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() {
65 return ibus_bus_; 66 return ibus_bus_;
66 } 67 }
67 68
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 263
263 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( 264 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService(
264 const dbus::ObjectPath& object_path) { 265 const dbus::ObjectPath& object_path) {
265 } 266 }
266 267
267 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { 268 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() {
268 return mock_ibus_panel_service_.get(); 269 return mock_ibus_panel_service_.get();
269 } 270 }
270 271
271 } // namespace chromeos 272 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/chromeos.gyp ('k') | dbus/dbus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698