diff options
author | haruki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 13:01:16 +0000 |
---|---|---|
committer | haruki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 13:01:16 +0000 |
commit | d437cab2025acfdd5370c6ddd7f9a96b7454fd18 (patch) | |
tree | d61995a79e192d202fc8e878ec328b454a26a62e | |
parent | c77be0a5ec732a862dd405dc4e90a94d30e3690d (diff) | |
download | chromium_src-d437cab2025acfdd5370c6ddd7f9a96b7454fd18.zip chromium_src-d437cab2025acfdd5370c6ddd7f9a96b7454fd18.tar.gz chromium_src-d437cab2025acfdd5370c6ddd7f9a96b7454fd18.tar.bz2 |
dbus: Add FakeOldBluetooth{Adapter,Device,Manager}
They are used in MockDBusThreadManagerWithoutGMock and stub implementations in DBusThreadManager.
BUG=234084,234461
TEST=trybots
R=satorux@chromium.org
Review URL: https://codereview.chromium.org/14508007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197604 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chromeos/chromeos.gyp | 15 | ||||
-rw-r--r-- | chromeos/dbus/bluetooth_adapter_client.cc | 179 | ||||
-rw-r--r-- | chromeos/dbus/bluetooth_device_client.cc | 128 | ||||
-rw-r--r-- | chromeos/dbus/bluetooth_manager_client.cc | 87 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_adapter_client.cc | 176 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_adapter_client.h | 87 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_device_client.cc | 122 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_device_client.h | 67 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_manager_client.cc | 84 | ||||
-rw-r--r-- | chromeos/dbus/fake_old_bluetooth_manager_client.h | 53 | ||||
-rw-r--r-- | chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc | 15 | ||||
-rw-r--r-- | chromeos/dbus/mock_dbus_thread_manager_without_gmock.h | 10 |
12 files changed, 629 insertions, 394 deletions
diff --git a/chromeos/chromeos.gyp b/chromeos/chromeos.gyp index 8477612c..eb864bd 100644 --- a/chromeos/chromeos.gyp +++ b/chromeos/chromeos.gyp @@ -111,6 +111,12 @@ 'dbus/fake_bluetooth_profile_manager_client.h', 'dbus/fake_bluetooth_profile_service_provider.cc', 'dbus/fake_bluetooth_profile_service_provider.h', + 'dbus/fake_old_bluetooth_adapter_client.cc', + 'dbus/fake_old_bluetooth_adapter_client.h', + 'dbus/fake_old_bluetooth_device_client.cc', + 'dbus/fake_old_bluetooth_device_client.h', + 'dbus/fake_old_bluetooth_manager_client.cc', + 'dbus/fake_old_bluetooth_manager_client.h', 'dbus/fake_image_burner_client.cc', 'dbus/fake_image_burner_client.h', 'dbus/fake_system_clock_client.cc', @@ -390,16 +396,25 @@ 'type': 'static_library', 'dependencies': [ '../build/linux/system.gyp:dbus', + '../dbus/dbus.gyp:dbus', 'chromeos', 'power_manager_proto', ], 'sources': [ + 'dbus/bluetooth_property.cc', + 'dbus/bluetooth_property.h', 'dbus/fake_cros_disks_client.cc', 'dbus/fake_cros_disks_client.h', 'dbus/fake_cryptohome_client.cc', 'dbus/fake_cryptohome_client.h', 'dbus/fake_image_burner_client.cc', 'dbus/fake_image_burner_client.h', + 'dbus/fake_old_bluetooth_adapter_client.cc', + 'dbus/fake_old_bluetooth_adapter_client.h', + 'dbus/fake_old_bluetooth_device_client.cc', + 'dbus/fake_old_bluetooth_device_client.h', + 'dbus/fake_old_bluetooth_manager_client.cc', + 'dbus/fake_old_bluetooth_manager_client.h', 'dbus/fake_power_manager_client.cc', 'dbus/fake_power_manager_client.h', 'dbus/fake_shill_manager_client.cc', diff --git a/chromeos/dbus/bluetooth_adapter_client.cc b/chromeos/dbus/bluetooth_adapter_client.cc index 56675e8..aa6e3e9 100644 --- a/chromeos/dbus/bluetooth_adapter_client.cc +++ b/chromeos/dbus/bluetooth_adapter_client.cc @@ -14,6 +14,7 @@ #include "chromeos/dbus/bluetooth_device_client.h" #include "chromeos/dbus/bluetooth_manager_client.h" #include "chromeos/dbus/bluetooth_property.h" +#include "chromeos/dbus/fake_old_bluetooth_adapter_client.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -735,182 +736,6 @@ class BluetoothAdapterClientImpl: public BluetoothAdapterClient, DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterClientImpl); }; -// The BluetoothAdapterClient implementation used on Linux desktop, which does -// nothing. -class BluetoothAdapterClientStubImpl : public BluetoothAdapterClient { - public: - struct Properties : public BluetoothAdapterClient::Properties { - explicit Properties(const PropertyChangedCallback& callback) - : BluetoothAdapterClient::Properties(NULL, callback) { - } - - virtual ~Properties() { - } - - virtual void Get(dbus::PropertyBase* property, - dbus::PropertySet::GetCallback callback) OVERRIDE { - VLOG(1) << "Get " << property->name(); - callback.Run(false); - } - - virtual void GetAll() OVERRIDE { - VLOG(1) << "GetAll"; - } - - virtual void Set(dbus::PropertyBase *property, - dbus::PropertySet::SetCallback callback) OVERRIDE { - VLOG(1) << "Set " << property->name(); - if (property->name() == "Powered") { - property->ReplaceValueWithSetValue(); - callback.Run(true); - } else { - callback.Run(false); - } - } - }; - - BluetoothAdapterClientStubImpl() { - properties_.reset(new Properties(base::Bind( - &BluetoothAdapterClientStubImpl::OnPropertyChanged, - base::Unretained(this)))); - - properties_->address.ReplaceValue("hci0"); - properties_->name.ReplaceValue("Fake Adapter"); - properties_->pairable.ReplaceValue(true); - - std::vector<dbus::ObjectPath> devices; - devices.push_back(dbus::ObjectPath("/fake/hci0/dev0")); - properties_->devices.ReplaceValue(devices); - } - - // BluetoothAdapterClient override. - virtual void AddObserver(Observer* observer) OVERRIDE { - observers_.AddObserver(observer); - } - - // BluetoothAdapterClient override. - virtual void RemoveObserver(Observer* observer) OVERRIDE { - observers_.RemoveObserver(observer); - } - - // BluetoothAdapterClient override. - virtual Properties* GetProperties(const dbus::ObjectPath& object_path) - OVERRIDE { - VLOG(1) << "GetProperties: " << object_path.value(); - if (object_path.value() == "/fake/hci0") - return properties_.get(); - else - return NULL; - } - - // BluetoothAdapterClient override. - virtual void RequestSession(const dbus::ObjectPath& object_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "RequestSession: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void ReleaseSession(const dbus::ObjectPath& object_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "ReleaseSession: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void StartDiscovery(const dbus::ObjectPath& object_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "StartDiscovery: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void StopDiscovery(const dbus::ObjectPath& object_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "StopDiscovery: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void FindDevice(const dbus::ObjectPath& object_path, - const std::string& address, - const DeviceCallback& callback) OVERRIDE { - VLOG(1) << "FindDevice: " << object_path.value() << " " << address; - callback.Run(dbus::ObjectPath(), false); - } - - // BluetoothAdapterClient override. - virtual void CreateDevice(const dbus::ObjectPath& object_path, - const std::string& address, - const CreateDeviceCallback& callback, - const CreateDeviceErrorCallback& error_callback) - OVERRIDE { - VLOG(1) << "CreateDevice: " << object_path.value() << " " << address; - error_callback.Run("", ""); - } - - // BluetoothAdapterClient override. - virtual void CreatePairedDevice( - const dbus::ObjectPath& object_path, const std::string& address, - const dbus::ObjectPath& agent_path, const std::string& capability, - const CreateDeviceCallback& callback, - const CreateDeviceErrorCallback& error_callback) OVERRIDE { - VLOG(1) << "CreatePairedDevice: " << object_path.value() << " " << address - << " " << agent_path.value() << " " << capability; - error_callback.Run("", ""); - } - - // BluetoothAdapterClient override. - virtual void CancelDeviceCreation(const dbus::ObjectPath& object_path, - const std::string& address, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "CancelDeviceCreation: " << object_path.value() - << " " << address; - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void RemoveDevice(const dbus::ObjectPath& object_path, - const dbus::ObjectPath& device_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "RemoveDevice: " << object_path.value() - << " " << device_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void RegisterAgent(const dbus::ObjectPath& object_path, - const dbus::ObjectPath& agent_path, - const std::string& capability, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "RegisterAgent: " << object_path.value() - << " " << agent_path.value(); - callback.Run(object_path, false); - } - - // BluetoothAdapterClient override. - virtual void UnregisterAgent(const dbus::ObjectPath& object_path, - const dbus::ObjectPath& agent_path, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "UnregisterAgent: " << object_path.value() - << " " << agent_path.value(); - callback.Run(object_path, false); - } - - private: - void OnPropertyChanged(const std::string& property_name) { - FOR_EACH_OBSERVER(BluetoothAdapterClient::Observer, observers_, - AdapterPropertyChanged(dbus::ObjectPath("/fake/hci0"), - property_name)); - } - - // List of observers interested in event notifications from us. - ObserverList<Observer> observers_; - - // Static properties we return. - scoped_ptr<Properties> properties_; -}; - BluetoothAdapterClient::BluetoothAdapterClient() { } @@ -924,7 +749,7 @@ BluetoothAdapterClient* BluetoothAdapterClient::Create( if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) return new BluetoothAdapterClientImpl(bus, manager_client); DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); - return new BluetoothAdapterClientStubImpl(); + return new FakeOldBluetoothAdapterClient(); } } // namespace chromeos diff --git a/chromeos/dbus/bluetooth_device_client.cc b/chromeos/dbus/bluetooth_device_client.cc index 00a0f2e..69f8072 100644 --- a/chromeos/dbus/bluetooth_device_client.cc +++ b/chromeos/dbus/bluetooth_device_client.cc @@ -12,6 +12,7 @@ #include "base/stl_util.h" #include "chromeos/dbus/bluetooth_adapter_client.h" #include "chromeos/dbus/bluetooth_property.h" +#include "chromeos/dbus/fake_old_bluetooth_device_client.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -463,131 +464,6 @@ class BluetoothDeviceClientImpl: public BluetoothDeviceClient, DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceClientImpl); }; -// The BluetoothDeviceClient implementation used on Linux desktop, which does -// nothing. -class BluetoothDeviceClientStubImpl : public BluetoothDeviceClient { - public: - struct Properties : public BluetoothDeviceClient::Properties { - explicit Properties(const PropertyChangedCallback& callback) - : BluetoothDeviceClient::Properties(NULL, callback) { - } - - virtual ~Properties() { - } - - virtual void Get(dbus::PropertyBase* property, - dbus::PropertySet::GetCallback callback) OVERRIDE { - VLOG(1) << "Get " << property->name(); - callback.Run(false); - } - - virtual void GetAll() OVERRIDE { - VLOG(1) << "GetAll"; - } - - virtual void Set(dbus::PropertyBase *property, - dbus::PropertySet::SetCallback callback) OVERRIDE { - VLOG(1) << "Set " << property->name(); - callback.Run(false); - } - }; - - BluetoothDeviceClientStubImpl() { - dbus::ObjectPath dev0("/fake/hci0/dev0"); - - Properties* properties = new Properties(base::Bind( - &BluetoothDeviceClientStubImpl::OnPropertyChanged, - base::Unretained(this), - dev0)); - properties->address.ReplaceValue("00:11:22:33:44:55"); - properties->name.ReplaceValue("Fake Device"); - properties->paired.ReplaceValue(true); - properties->trusted.ReplaceValue(true); - - properties_map_[dev0] = properties; - } - - virtual ~BluetoothDeviceClientStubImpl() { - // Clean up Properties structures - STLDeleteValues(&properties_map_); - } - - // BluetoothDeviceClient override. - virtual void AddObserver(Observer* observer) OVERRIDE { - observers_.AddObserver(observer); - } - - // BluetoothDeviceClient override. - virtual void RemoveObserver(Observer* observer) OVERRIDE { - observers_.RemoveObserver(observer); - } - - // BluetoothDeviceClient override. - virtual Properties* GetProperties(const dbus::ObjectPath& object_path) - OVERRIDE { - VLOG(1) << "GetProperties: " << object_path.value(); - PropertiesMap::iterator iter = properties_map_.find(object_path); - if (iter != properties_map_.end()) - return iter->second; - return NULL; - } - - // BluetoothDeviceClient override. - virtual void DiscoverServices(const dbus::ObjectPath& object_path, - const std::string& pattern, - const ServicesCallback& callback) OVERRIDE { - VLOG(1) << "DiscoverServices: " << object_path.value() << " " << pattern; - - ServiceMap services; - callback.Run(object_path, services, false); - } - - // BluetoothDeviceClient override. - virtual void CancelDiscovery(const dbus::ObjectPath& object_path, - const DeviceCallback& callback) OVERRIDE { - VLOG(1) << "CancelDiscovery: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothDeviceClient override. - virtual void Disconnect(const dbus::ObjectPath& object_path, - const DeviceCallback& callback) OVERRIDE { - VLOG(1) << "Disconnect: " << object_path.value(); - callback.Run(object_path, false); - } - - // BluetoothDeviceClient override. - virtual void CreateNode(const dbus::ObjectPath& object_path, - const std::string& uuid, - const NodeCallback& callback) OVERRIDE { - VLOG(1) << "CreateNode: " << object_path.value() << " " << uuid; - callback.Run(dbus::ObjectPath(), false); - } - - // BluetoothDeviceClient override. - virtual void RemoveNode(const dbus::ObjectPath& object_path, - const dbus::ObjectPath& node_path, - const DeviceCallback& callback) OVERRIDE { - VLOG(1) << "RemoveNode: " << object_path.value() - << " " << node_path.value(); - callback.Run(object_path, false); - } - - private: - void OnPropertyChanged(dbus::ObjectPath object_path, - const std::string& property_name) { - FOR_EACH_OBSERVER(BluetoothDeviceClient::Observer, observers_, - DevicePropertyChanged(object_path, property_name)); - } - - // List of observers interested in event notifications from us. - ObserverList<Observer> observers_; - - // Static properties we typedef. - typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap; - PropertiesMap properties_map_; -}; - BluetoothDeviceClient::BluetoothDeviceClient() { } @@ -601,7 +477,7 @@ BluetoothDeviceClient* BluetoothDeviceClient::Create( if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) return new BluetoothDeviceClientImpl(bus, adapter_client); DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); - return new BluetoothDeviceClientStubImpl(); + return new FakeOldBluetoothDeviceClient(); } } // namespace chromeos diff --git a/chromeos/dbus/bluetooth_manager_client.cc b/chromeos/dbus/bluetooth_manager_client.cc index b8b3126..f278160 100644 --- a/chromeos/dbus/bluetooth_manager_client.cc +++ b/chromeos/dbus/bluetooth_manager_client.cc @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "chromeos/dbus/bluetooth_property.h" +#include "chromeos/dbus/fake_old_bluetooth_manager_client.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -270,90 +271,6 @@ class BluetoothManagerClientImpl : public BluetoothManagerClient { DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClientImpl); }; -// The BluetoothManagerClient implementation used on Linux desktop, which does -// nothing. -class BluetoothManagerClientStubImpl : public BluetoothManagerClient { - public: - struct Properties : public BluetoothManagerClient::Properties { - explicit Properties(const PropertyChangedCallback& callback) - : BluetoothManagerClient::Properties(NULL, callback) { - } - - virtual ~Properties() { - } - - virtual void Get(dbus::PropertyBase* property, - dbus::PropertySet::GetCallback callback) OVERRIDE { - VLOG(1) << "Get " << property->name(); - callback.Run(false); - } - - virtual void GetAll() OVERRIDE { - VLOG(1) << "GetAll"; - } - - virtual void Set(dbus::PropertyBase* property, - dbus::PropertySet::SetCallback callback) OVERRIDE { - VLOG(1) << "Set " << property->name(); - callback.Run(false); - } - }; - - BluetoothManagerClientStubImpl() { - properties_.reset(new Properties(base::Bind( - &BluetoothManagerClientStubImpl::OnPropertyChanged, - base::Unretained(this)))); - - std::vector<dbus::ObjectPath> adapters; - adapters.push_back(dbus::ObjectPath("/fake/hci0")); - properties_->adapters.ReplaceValue(adapters); - } - - // BluetoothManagerClient override. - virtual void AddObserver(Observer* observer) OVERRIDE { - observers_.AddObserver(observer); - } - - // BluetoothManagerClient override. - virtual void RemoveObserver(Observer* observer) OVERRIDE { - observers_.RemoveObserver(observer); - } - - // BluetoothManagerClient override. - virtual Properties* GetProperties() OVERRIDE { - VLOG(1) << "GetProperties"; - return properties_.get(); - } - - // BluetoothManagerClient override. - virtual void DefaultAdapter(const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "DefaultAdapter."; - callback.Run(dbus::ObjectPath("/fake/hci0"), true); - } - - // BluetoothManagerClient override. - virtual void FindAdapter(const std::string& address, - const AdapterCallback& callback) OVERRIDE { - VLOG(1) << "FindAdapter: " << address; - if (address == "hci0") - callback.Run(dbus::ObjectPath("/fake/hci0"), true); - else - callback.Run(dbus::ObjectPath(), false); - } - - private: - void OnPropertyChanged(const std::string& property_name) { - FOR_EACH_OBSERVER(BluetoothManagerClient::Observer, observers_, - ManagerPropertyChanged(property_name)); - } - - // List of observers interested in event notifications from us. - ObserverList<Observer> observers_; - - // Static properties we return. - scoped_ptr<Properties> properties_; -}; - BluetoothManagerClient::BluetoothManagerClient() { } @@ -366,7 +283,7 @@ BluetoothManagerClient* BluetoothManagerClient::Create( if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) return new BluetoothManagerClientImpl(bus); DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); - return new BluetoothManagerClientStubImpl(); + return new FakeOldBluetoothManagerClient(); } } // namespace chromeos diff --git a/chromeos/dbus/fake_old_bluetooth_adapter_client.cc b/chromeos/dbus/fake_old_bluetooth_adapter_client.cc new file mode 100644 index 0000000..12ca37c --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_adapter_client.cc @@ -0,0 +1,176 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/dbus/fake_old_bluetooth_adapter_client.h" + +namespace chromeos { + +FakeOldBluetoothAdapterClient::Properties::Properties( + const PropertyChangedCallback& callback) : + BluetoothAdapterClient::Properties(NULL, callback) { +} + +FakeOldBluetoothAdapterClient::Properties::~Properties() { +} + +void FakeOldBluetoothAdapterClient::Properties::Get( + dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) { + VLOG(1)<< "Get " << property->name(); + callback.Run(false); +} + +void FakeOldBluetoothAdapterClient::Properties::GetAll() { + VLOG(1) << "GetAll"; +} + +void FakeOldBluetoothAdapterClient::Properties::Set( + dbus::PropertyBase *property, + dbus::PropertySet::SetCallback callback) { + VLOG(1) << "Set " << property->name(); + if (property->name() == "Powered") { + property->ReplaceValueWithSetValue(); + callback.Run(true); + } else { + callback.Run(false); + } +} + +FakeOldBluetoothAdapterClient::FakeOldBluetoothAdapterClient() { + properties_.reset(new Properties(base::Bind( + &FakeOldBluetoothAdapterClient::OnPropertyChanged, + base::Unretained(this)))); + + properties_->address.ReplaceValue("hci0"); + properties_->name.ReplaceValue("Fake Adapter"); + properties_->pairable.ReplaceValue(true); + + std::vector<dbus::ObjectPath> devices; + devices.push_back(dbus::ObjectPath("/fake/hci0/dev0")); + properties_->devices.ReplaceValue(devices); +} + +FakeOldBluetoothAdapterClient::~FakeOldBluetoothAdapterClient() { +} + +void FakeOldBluetoothAdapterClient::AddObserver(Observer* observer) { + observers_.AddObserver(observer); +} + +void FakeOldBluetoothAdapterClient::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); +} + +FakeOldBluetoothAdapterClient::Properties* +FakeOldBluetoothAdapterClient::GetProperties( + const dbus::ObjectPath& object_path) { + VLOG(1) << "GetProperties: " << object_path.value(); + if (object_path.value() == "/fake/hci0") + return properties_.get(); + else + return NULL; +} + +void FakeOldBluetoothAdapterClient::RequestSession( + const dbus::ObjectPath& object_path, + const AdapterCallback& callback) { + VLOG(1) << "RequestSession: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::ReleaseSession( + const dbus::ObjectPath& object_path, + const AdapterCallback& callback) { + VLOG(1) << "ReleaseSession: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::StartDiscovery( + const dbus::ObjectPath& object_path, + const AdapterCallback& callback) { + VLOG(1) << "StartDiscovery: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::StopDiscovery( + const dbus::ObjectPath & object_path, + const AdapterCallback& callback) { + VLOG(1) << "StopDiscovery: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::FindDevice( + const dbus::ObjectPath& object_path, + const std::string& address, + const DeviceCallback& callback) { + VLOG(1) << "FindDevice: " << object_path.value() << " " << address; + callback.Run(dbus::ObjectPath(), false); +} + +void FakeOldBluetoothAdapterClient::CreateDevice( + const dbus::ObjectPath& object_path, + const std::string& address, + const CreateDeviceCallback& callback, + const CreateDeviceErrorCallback& error_callback) { + VLOG(1) << "CreateDevice: " << object_path.value() << " " << address; + error_callback.Run("", ""); +} + +void FakeOldBluetoothAdapterClient::CreatePairedDevice( + const dbus::ObjectPath& object_path, + const std::string& address, + const dbus::ObjectPath& agent_path, + const std::string& capability, + const CreateDeviceCallback& callback, + const CreateDeviceErrorCallback& error_callback) { + VLOG(1) << "CreatePairedDevice: " << object_path.value() << " " << address + << " " << agent_path.value() << " " << capability; + error_callback.Run("", ""); +} + +void FakeOldBluetoothAdapterClient::CancelDeviceCreation( + const dbus::ObjectPath& object_path, + const std::string& address, + const AdapterCallback& callback) { + VLOG(1) << "CancelDeviceCreation: " << object_path.value() + << " " << address; + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::RemoveDevice( + const dbus::ObjectPath& object_path, + const dbus::ObjectPath& device_path, + const AdapterCallback& callback) { + VLOG(1) << "RemoveDevice: " << object_path.value() + << " " << device_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::RegisterAgent( + const dbus::ObjectPath& object_path, + const dbus::ObjectPath& agent_path, + const std::string& capability, + const AdapterCallback& callback) { + VLOG(1) << "RegisterAgent: " << object_path.value() + << " " << agent_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::UnregisterAgent( + const dbus::ObjectPath& object_path, + const dbus::ObjectPath& agent_path, + const AdapterCallback& callback) { + VLOG(1) << "UnregisterAgent: " << object_path.value() + << " " << agent_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothAdapterClient::OnPropertyChanged( + const std::string&property_name) { + FOR_EACH_OBSERVER(BluetoothAdapterClient::Observer, observers_, + AdapterPropertyChanged(dbus::ObjectPath("/fake/hci0"), + property_name)); +} + +} // namespace chromeos diff --git a/chromeos/dbus/fake_old_bluetooth_adapter_client.h b/chromeos/dbus/fake_old_bluetooth_adapter_client.h new file mode 100644 index 0000000..fc73f4f --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_adapter_client.h @@ -0,0 +1,87 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_ADAPTER_CLIENT_H_ +#define CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_ADAPTER_CLIENT_H_ + +#include "chromeos/dbus/bluetooth_adapter_client.h" + +namespace chromeos { + +// A fake implementation of BluetoothAdapterClient used on Linux desktop and for +// tests. This class does nothing. +class FakeOldBluetoothAdapterClient : public BluetoothAdapterClient { + public: + struct Properties : public BluetoothAdapterClient::Properties { + explicit Properties(const PropertyChangedCallback& callback); + virtual ~Properties(); + + // BluetoothAdapterClient::Properties overrides. + virtual void Get(dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) OVERRIDE; + virtual void GetAll() OVERRIDE; + virtual void Set(dbus::PropertyBase *property, + dbus::PropertySet::SetCallback callback) OVERRIDE; + }; + + FakeOldBluetoothAdapterClient(); + virtual ~FakeOldBluetoothAdapterClient(); + + // BluetoothAdapterClient overrides. + virtual void AddObserver(Observer* observer) OVERRIDE; + virtual void RemoveObserver(Observer* observer) OVERRIDE; + virtual Properties* GetProperties( + const dbus::ObjectPath& object_path) OVERRIDE; + virtual void RequestSession(const dbus::ObjectPath& object_path, + const AdapterCallback& callback) OVERRIDE; + virtual void ReleaseSession(const dbus::ObjectPath& object_path, + const AdapterCallback& callback) OVERRIDE; + virtual void StartDiscovery(const dbus::ObjectPath& object_path, + const AdapterCallback& callback) OVERRIDE; + virtual void StopDiscovery(const dbus::ObjectPath& object_path, + const AdapterCallback& callback) OVERRIDE; + virtual void FindDevice(const dbus::ObjectPath& object_path, + const std::string& address, + const DeviceCallback& callback) OVERRIDE; + virtual void CreateDevice( + const dbus::ObjectPath& object_path, + const std::string& address, + const CreateDeviceCallback& callback, + const CreateDeviceErrorCallback& error_callback) OVERRIDE; + virtual void CreatePairedDevice( + const dbus::ObjectPath& object_path, + const std::string& address, + const dbus::ObjectPath& agent_path, + const std::string& capability, + const CreateDeviceCallback& callback, + const CreateDeviceErrorCallback& error_callback) OVERRIDE; + virtual void CancelDeviceCreation(const dbus::ObjectPath& object_path, + const std::string& address, + const AdapterCallback& callback) OVERRIDE; + virtual void RemoveDevice(const dbus::ObjectPath& object_path, + const dbus::ObjectPath& device_path, + const AdapterCallback& callback) OVERRIDE; + virtual void RegisterAgent(const dbus::ObjectPath& object_path, + const dbus::ObjectPath& agent_path, + const std::string& capability, + const AdapterCallback& callback) OVERRIDE; + virtual void UnregisterAgent(const dbus::ObjectPath& object_path, + const dbus::ObjectPath& agent_path, + const AdapterCallback& callback) OVERRIDE; + + // List of observers interested in event notifications from us. + ObserverList<Observer> observers_; + + // Static properties we return. + scoped_ptr<Properties> properties_; + + private: + void OnPropertyChanged(const std::string& property_name); + + DISALLOW_COPY_AND_ASSIGN(FakeOldBluetoothAdapterClient); +}; + +} // namespace chromeos + +#endif // CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_ADAPTER_CLIENT_H_ diff --git a/chromeos/dbus/fake_old_bluetooth_device_client.cc b/chromeos/dbus/fake_old_bluetooth_device_client.cc new file mode 100644 index 0000000..a06a426 --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_device_client.cc @@ -0,0 +1,122 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/stl_util.h" +#include "chromeos/dbus/fake_old_bluetooth_device_client.h" + +namespace chromeos { + +FakeOldBluetoothDeviceClient::Properties::Properties( + const PropertyChangedCallback& callback) : + BluetoothDeviceClient::Properties(NULL, callback) { +} + +FakeOldBluetoothDeviceClient::Properties::~Properties() { +} + +void FakeOldBluetoothDeviceClient::Properties::Get( + dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) { + VLOG(1)<< "Get " << property->name(); + callback.Run(false); +} + +void FakeOldBluetoothDeviceClient::Properties::GetAll() { + VLOG(1) << "GetAll"; +} + +void FakeOldBluetoothDeviceClient::Properties::Set( + dbus::PropertyBase *property, + dbus::PropertySet::SetCallback callback) { + VLOG(1) << "Set " << property->name(); + callback.Run(false); +} + +FakeOldBluetoothDeviceClient::FakeOldBluetoothDeviceClient() { + dbus::ObjectPath dev0("/fake/hci0/dev0"); + + Properties* properties = new Properties(base::Bind( + &FakeOldBluetoothDeviceClient::OnPropertyChanged, + base::Unretained(this), + dev0)); + properties->address.ReplaceValue("00:11:22:33:44:55"); + properties->name.ReplaceValue("Fake Device"); + properties->paired.ReplaceValue(true); + properties->trusted.ReplaceValue(true); + + properties_map_[dev0] = properties; +} + +FakeOldBluetoothDeviceClient::~FakeOldBluetoothDeviceClient() { + // Clean up Properties structures + STLDeleteValues(&properties_map_); +} + +void FakeOldBluetoothDeviceClient::AddObserver(Observer* observer) { + observers_.AddObserver(observer); +} + +void FakeOldBluetoothDeviceClient::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); +} + +FakeOldBluetoothDeviceClient::Properties* +FakeOldBluetoothDeviceClient::GetProperties( + const dbus::ObjectPath& object_path) { + VLOG(1)<< "GetProperties: " << object_path.value(); + PropertiesMap::iterator iter = properties_map_.find(object_path); + if (iter != properties_map_.end()) + return iter->second; + return NULL; +} + +void FakeOldBluetoothDeviceClient::DiscoverServices( + const dbus::ObjectPath& object_path, + const std::string& pattern, + const ServicesCallback& callback) { + VLOG(1) << "DiscoverServices: " << object_path.value() << " " << pattern; + + ServiceMap services; + callback.Run(object_path, services, false); +} + +void FakeOldBluetoothDeviceClient::CancelDiscovery( + const dbus::ObjectPath& object_path, + const DeviceCallback& callback) { + VLOG(1) << "CancelDiscovery: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothDeviceClient::Disconnect( + const dbus::ObjectPath& object_path, + const DeviceCallback& callback) { + VLOG(1) << "Disconnect: " << object_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothDeviceClient::CreateNode( + const dbus::ObjectPath& object_path, + const std::string& uuid, + const NodeCallback& callback) { + VLOG(1) << "CreateNode: " << object_path.value() << " " << uuid; + callback.Run(dbus::ObjectPath(), false); +} + +void FakeOldBluetoothDeviceClient::RemoveNode( + const dbus::ObjectPath& object_path, + const dbus::ObjectPath& node_path, + const DeviceCallback& callback) { + VLOG(1) << "RemoveNode: " << object_path.value() + << " " << node_path.value(); + callback.Run(object_path, false); +} + +void FakeOldBluetoothDeviceClient::OnPropertyChanged( + dbus::ObjectPath object_path, + const std::string& property_name) { + FOR_EACH_OBSERVER(BluetoothDeviceClient::Observer, observers_, + DevicePropertyChanged(object_path, property_name)); +} + +} // namespace chromeos diff --git a/chromeos/dbus/fake_old_bluetooth_device_client.h b/chromeos/dbus/fake_old_bluetooth_device_client.h new file mode 100644 index 0000000..e957d47 --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_device_client.h @@ -0,0 +1,67 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_ +#define CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_ + +#include "chromeos/dbus/bluetooth_device_client.h" + +namespace chromeos { + +// A fake implementation of BluetoothDeviceClient used on Linux desktop and for +// tests. . This class does nothing. +class FakeOldBluetoothDeviceClient : public BluetoothDeviceClient { + public: + struct Properties : public BluetoothDeviceClient::Properties { + explicit Properties(const PropertyChangedCallback& callback); + + virtual ~Properties(); + + // BluetoothDeviceClient::Properties overrides. + virtual void Get(dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) OVERRIDE; + virtual void GetAll() OVERRIDE; + virtual void Set(dbus::PropertyBase *property, + dbus::PropertySet::SetCallback callback) OVERRIDE; + }; + + FakeOldBluetoothDeviceClient(); + virtual ~FakeOldBluetoothDeviceClient(); + + // BluetoothDeviceClient overrides. + virtual void AddObserver(Observer* observer) OVERRIDE; + virtual void RemoveObserver(Observer* observer) OVERRIDE; + virtual Properties* GetProperties( + const dbus::ObjectPath& object_path) OVERRIDE; + virtual void DiscoverServices(const dbus::ObjectPath& object_path, + const std::string& pattern, + const ServicesCallback& callback) OVERRIDE; + virtual void CancelDiscovery(const dbus::ObjectPath& object_path, + const DeviceCallback& callback) OVERRIDE; + virtual void Disconnect(const dbus::ObjectPath& object_path, + const DeviceCallback& callback) OVERRIDE; + virtual void CreateNode(const dbus::ObjectPath& object_path, + const std::string& uuid, + const NodeCallback& callback) OVERRIDE; + virtual void RemoveNode(const dbus::ObjectPath& object_path, + const dbus::ObjectPath& node_path, + const DeviceCallback& callback) OVERRIDE; + + private: + void OnPropertyChanged(dbus::ObjectPath object_path, + const std::string& property_name); + + // List of observers interested in event notifications from us. + ObserverList<Observer> observers_; + + // Static properties we typedef. + typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap; + PropertiesMap properties_map_; + + DISALLOW_COPY_AND_ASSIGN(FakeOldBluetoothDeviceClient); +}; + +} // namespace chromeos + +#endif // CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_DEVICE_CLIENT_H_ diff --git a/chromeos/dbus/fake_old_bluetooth_manager_client.cc b/chromeos/dbus/fake_old_bluetooth_manager_client.cc new file mode 100644 index 0000000..b26c80a --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_manager_client.cc @@ -0,0 +1,84 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/dbus/fake_old_bluetooth_manager_client.h" + +namespace chromeos { + +FakeOldBluetoothManagerClient::Properties::Properties( + const PropertyChangedCallback& callback) : + BluetoothManagerClient::Properties(NULL, callback) { +} + +FakeOldBluetoothManagerClient::Properties::~Properties() { +} + +void FakeOldBluetoothManagerClient::Properties::Get( + dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) { + VLOG(1)<< "Get " << property->name(); + callback.Run(false); +} + +void FakeOldBluetoothManagerClient::Properties::GetAll() { + VLOG(1) << "GetAll"; +} + +void FakeOldBluetoothManagerClient::Properties::Set( + dbus::PropertyBase*property, + dbus::PropertySet::SetCallback callback) { + VLOG(1) << "Set " << property->name(); + callback.Run(false); +} + +FakeOldBluetoothManagerClient::FakeOldBluetoothManagerClient() { + properties_.reset(new Properties(base::Bind( + &FakeOldBluetoothManagerClient::OnPropertyChanged, + base::Unretained(this)))); + + std::vector<dbus::ObjectPath> adapters; + adapters.push_back(dbus::ObjectPath("/fake/hci0")); + properties_->adapters.ReplaceValue(adapters); +} + +FakeOldBluetoothManagerClient::~FakeOldBluetoothManagerClient() { +} + +void FakeOldBluetoothManagerClient::AddObserver(Observer* observer) { + observers_.AddObserver(observer); +} + +void FakeOldBluetoothManagerClient::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); +} + +FakeOldBluetoothManagerClient::Properties* +FakeOldBluetoothManagerClient::GetProperties() { + VLOG(1) << "GetProperties"; + return properties_.get(); +} + +void FakeOldBluetoothManagerClient::DefaultAdapter( + const AdapterCallback& callback) { + VLOG(1) << "DefaultAdapter."; + callback.Run(dbus::ObjectPath("/fake/hci0"), true); +} + +void FakeOldBluetoothManagerClient::FindAdapter( + const std::string& address, + const AdapterCallback& callback) { + VLOG(1) << "FindAdapter: " << address; + if (address == "hci0") + callback.Run(dbus::ObjectPath("/fake/hci0"), true); + else + callback.Run(dbus::ObjectPath(), false); +} + +void FakeOldBluetoothManagerClient::OnPropertyChanged( + const std::string& property_name) { + FOR_EACH_OBSERVER(BluetoothManagerClient::Observer, observers_, + ManagerPropertyChanged(property_name)); +} + +} // namespace chromeos diff --git a/chromeos/dbus/fake_old_bluetooth_manager_client.h b/chromeos/dbus/fake_old_bluetooth_manager_client.h new file mode 100644 index 0000000..bbf3edb --- /dev/null +++ b/chromeos/dbus/fake_old_bluetooth_manager_client.h @@ -0,0 +1,53 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ +#define CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ + +#include "chromeos/dbus/bluetooth_manager_client.h" + +namespace chromeos { + +// A fake implementation of BluetoothManagerClient used on Linux desktop and for +// tests. This class does nothing. +class FakeOldBluetoothManagerClient : public BluetoothManagerClient { + public: + struct Properties : public BluetoothManagerClient::Properties { + explicit Properties(const PropertyChangedCallback& callback); + virtual ~Properties(); + + // BluetoothManagerClient::Properties overrides. + virtual void Get(dbus::PropertyBase* property, + dbus::PropertySet::GetCallback callback) OVERRIDE; + virtual void GetAll() OVERRIDE; + virtual void Set(dbus::PropertyBase* property, + dbus::PropertySet::SetCallback callback) OVERRIDE; + }; + + FakeOldBluetoothManagerClient(); + virtual ~FakeOldBluetoothManagerClient(); + + // BluetoothManagerClient overrides. + virtual void AddObserver(Observer* observer) OVERRIDE; + virtual void RemoveObserver(Observer* observer) OVERRIDE; + virtual Properties* GetProperties() OVERRIDE; + virtual void DefaultAdapter(const AdapterCallback& callback) OVERRIDE; + virtual void FindAdapter(const std::string& address, + const AdapterCallback& callback) OVERRIDE; + + private: + void OnPropertyChanged(const std::string& property_name); + + // List of observers interested in event notifications from us. + ObserverList<Observer> observers_; + + // Static properties we return. + scoped_ptr<Properties> properties_; + + DISALLOW_COPY_AND_ASSIGN(FakeOldBluetoothManagerClient); +}; + +} // namespace chromeos + +#endif // CHROMEOS_DBUS_FAKE_OLD_BLUETOOTH_MANAGER_CLIENT_H_ diff --git a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc index 2a4e530..40623d2 100644 --- a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc +++ b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc @@ -13,6 +13,9 @@ #include "chromeos/dbus/fake_cros_disks_client.h" #include "chromeos/dbus/fake_cryptohome_client.h" #include "chromeos/dbus/fake_image_burner_client.h" +#include "chromeos/dbus/fake_old_bluetooth_adapter_client.h" +#include "chromeos/dbus/fake_old_bluetooth_device_client.h" +#include "chromeos/dbus/fake_old_bluetooth_manager_client.h" #include "chromeos/dbus/fake_shill_manager_client.h" #include "chromeos/dbus/fake_system_clock_client.h" #include "chromeos/dbus/ibus/mock_ibus_client.h" @@ -36,6 +39,9 @@ MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() fake_image_burner_client_(new FakeImageBurnerClient), fake_shill_manager_client_(new FakeShillManagerClient), fake_system_clock_client_(new FakeSystemClockClient), + fake_old_bluetooth_manager_client_(new FakeOldBluetoothManagerClient), + fake_old_bluetooth_adapter_client_(new FakeOldBluetoothAdapterClient), + fake_old_bluetooth_device_client_(new FakeOldBluetoothDeviceClient), mock_ibus_client_(new MockIBusClient), mock_ibus_config_client_(new MockIBusConfigClient), mock_ibus_input_context_client_(new MockIBusInputContextClient), @@ -79,14 +85,12 @@ dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { BluetoothAdapterClient* MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() { - NOTIMPLEMENTED(); - return NULL; + return fake_old_bluetooth_adapter_client_.get(); } BluetoothDeviceClient* MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() { - NOTIMPLEMENTED(); - return NULL; + return fake_old_bluetooth_device_client_.get(); } BluetoothInputClient* @@ -97,8 +101,7 @@ BluetoothInputClient* BluetoothManagerClient* MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() { - NOTIMPLEMENTED(); - return NULL; + return fake_old_bluetooth_manager_client_.get(); } BluetoothNodeClient* diff --git a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.h b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.h index ff1e736..cb85610 100644 --- a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.h +++ b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.h @@ -26,6 +26,9 @@ class FakeBluetoothInputClient; class FakeBluetoothProfileManagerClient; class FakeCrosDisksClient; class FakeCryptohomeClient; +class FakeOldBluetoothAdapterClient; +class FakeOldBluetoothDeviceClient; +class FakeOldBluetoothManagerClient; class FakeShillManagerClient; class FakeImageBurnerClient; class FakeSystemClockClient; @@ -164,6 +167,7 @@ class MockDBusThreadManagerWithoutGMock : public DBusThreadManager { } private: + // These fake_bluetooth_*_client_ are for ExperimentalBluetooth*Client. scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; scoped_ptr<FakeBluetoothAgentManagerClient> fake_bluetooth_agent_manager_client_; @@ -177,6 +181,12 @@ class MockDBusThreadManagerWithoutGMock : public DBusThreadManager { scoped_ptr<FakeShillManagerClient> fake_shill_manager_client_; scoped_ptr<FakeSystemClockClient> fake_system_clock_client_; + // These fake_old_bluetooth_*_client_ are for old Bluetooth*Client. + // Will be removed once http://crbug.com/221813 is resolved. + scoped_ptr<FakeOldBluetoothManagerClient> fake_old_bluetooth_manager_client_; + scoped_ptr<FakeOldBluetoothAdapterClient> fake_old_bluetooth_adapter_client_; + scoped_ptr<FakeOldBluetoothDeviceClient> fake_old_bluetooth_device_client_; + scoped_ptr<MockIBusClient> mock_ibus_client_; scoped_ptr<MockIBusConfigClient> mock_ibus_config_client_; scoped_ptr<MockIBusInputContextClient> mock_ibus_input_context_client_; |