Commit 7b49f3cb authored by Pablo Ceballos's avatar Pablo Ceballos Committed by Commit Bot

ip_peripheral: IP Peripheral Service DBus client

BUG=b:151160990
TEST=chromeos_unittests --gtest_filter="IpPeripheralServiceClientTest.*"

Change-Id: I7ae2cd64a7c0dc4ae927142e015a8930965462d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134805
Commit-Queue: Pablo Ceballos <pceballos@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760516}
parent 8e788681
...@@ -136,6 +136,7 @@ source_set("chromeos") { ...@@ -136,6 +136,7 @@ source_set("chromeos") {
"//chromeos/dbus/cups_proxy", "//chromeos/dbus/cups_proxy",
"//chromeos/dbus/dlcservice", "//chromeos/dbus/dlcservice",
"//chromeos/dbus/dlcservice:dlcservice_proto", "//chromeos/dbus/dlcservice:dlcservice_proto",
"//chromeos/dbus/ip_peripheral",
"//chromeos/dbus/kerberos", "//chromeos/dbus/kerberos",
"//chromeos/dbus/kerberos:kerberos_proto", "//chromeos/dbus/kerberos:kerberos_proto",
"//chromeos/dbus/machine_learning", "//chromeos/dbus/machine_learning",
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/dlcservice/dlcservice_client.h" #include "chromeos/dbus/dlcservice/dlcservice_client.h"
#include "chromeos/dbus/initialize_dbus_client.h" #include "chromeos/dbus/initialize_dbus_client.h"
#include "chromeos/dbus/ip_peripheral/ip_peripheral_service_client.h"
#include "chromeos/dbus/kerberos/kerberos_client.h" #include "chromeos/dbus/kerberos/kerberos_client.h"
#include "chromeos/dbus/machine_learning/machine_learning_client.h" #include "chromeos/dbus/machine_learning/machine_learning_client.h"
#include "chromeos/dbus/media_analytics/media_analytics_client.h" #include "chromeos/dbus/media_analytics/media_analytics_client.h"
...@@ -67,6 +68,7 @@ void InitializeDBus() { ...@@ -67,6 +68,7 @@ void InitializeDBus() {
InitializeDBusClient<CryptohomeClient>(bus); InitializeDBusClient<CryptohomeClient>(bus);
InitializeDBusClient<CupsProxyClient>(bus); InitializeDBusClient<CupsProxyClient>(bus);
InitializeDBusClient<DlcserviceClient>(bus); InitializeDBusClient<DlcserviceClient>(bus);
InitializeDBusClient<IpPeripheralServiceClient>(bus);
InitializeDBusClient<KerberosClient>(bus); InitializeDBusClient<KerberosClient>(bus);
InitializeDBusClient<MachineLearningClient>(bus); InitializeDBusClient<MachineLearningClient>(bus);
InitializeDBusClient<MediaAnalyticsClient>(bus); InitializeDBusClient<MediaAnalyticsClient>(bus);
...@@ -106,6 +108,7 @@ void ShutdownDBus() { ...@@ -106,6 +108,7 @@ void ShutdownDBus() {
MediaAnalyticsClient::Shutdown(); MediaAnalyticsClient::Shutdown();
MachineLearningClient::Shutdown(); MachineLearningClient::Shutdown();
KerberosClient::Shutdown(); KerberosClient::Shutdown();
IpPeripheralServiceClient::Shutdown();
DlcserviceClient::Shutdown(); DlcserviceClient::Shutdown();
CupsProxyClient::Shutdown(); CupsProxyClient::Shutdown();
CryptohomeClient::Shutdown(); CryptohomeClient::Shutdown();
......
...@@ -211,6 +211,7 @@ source_set("unit_tests") { ...@@ -211,6 +211,7 @@ source_set("unit_tests") {
"//chromeos/dbus/cryptohome", "//chromeos/dbus/cryptohome",
"//chromeos/dbus/cryptohome:attestation_proto", "//chromeos/dbus/cryptohome:attestation_proto",
"//chromeos/dbus/dlcservice:test_support", "//chromeos/dbus/dlcservice:test_support",
"//chromeos/dbus/ip_peripheral:test_support",
"//chromeos/dbus/power:power_manager_proto", "//chromeos/dbus/power:power_manager_proto",
"//chromeos/dbus/power:test_support", "//chromeos/dbus/power:test_support",
"//chromeos/dbus/session_manager", "//chromeos/dbus/session_manager",
......
# Copyright 2020 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.
assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos")
component("ip_peripheral") {
defines = [ "IS_DBUS_IP_PERIPHERAL_CLIENT_IMPL" ]
deps = [
"//base",
"//dbus",
]
sources = [
"fake_ip_peripheral_service_client.cc",
"fake_ip_peripheral_service_client.h",
"ip_peripheral_service_client.cc",
"ip_peripheral_service_client.h",
]
}
source_set("test_support") {
testonly = true
public_deps = [ ":ip_peripheral" ]
deps = [
"//base",
"//base/test:test_support",
"//dbus:test_support",
"//testing/gmock",
"//testing/gtest",
]
sources = [ "ip_peripheral_service_client_unittest.cc" ]
}
// Copyright 2020 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/ip_peripheral/fake_ip_peripheral_service_client.h"
#include <utility>
#include "base/bind.h"
#include "base/threading/thread_task_runner_handle.h"
namespace chromeos {
namespace {
FakeIpPeripheralServiceClient* g_instance = nullptr;
constexpr int32_t kMinPan = -400;
constexpr int32_t kMaxPan = 400;
constexpr int32_t kMinTilt = -300;
constexpr int32_t kMaxTilt = 300;
constexpr int32_t kMinZoom = 100;
constexpr int32_t kMaxZoom = 500;
} // namespace
// static
FakeIpPeripheralServiceClient* FakeIpPeripheralServiceClient::Get() {
CHECK(g_instance);
return g_instance;
}
FakeIpPeripheralServiceClient::FakeIpPeripheralServiceClient() {
CHECK(!g_instance);
g_instance = this;
}
FakeIpPeripheralServiceClient::~FakeIpPeripheralServiceClient() {
CHECK_EQ(g_instance, this);
g_instance = nullptr;
}
void FakeIpPeripheralServiceClient::GetPan(const std::string& ip,
GetCallback callback) {
get_pan_call_count_++;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), true, pan_, kMinPan, kMaxPan));
}
void FakeIpPeripheralServiceClient::GetTilt(const std::string& ip,
GetCallback callback) {
get_tilt_call_count_++;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), true, tilt_, kMinTilt, kMaxTilt));
}
void FakeIpPeripheralServiceClient::GetZoom(const std::string& ip,
GetCallback callback) {
get_zoom_call_count_++;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), true, zoom_, kMinZoom, kMaxZoom));
}
void FakeIpPeripheralServiceClient::SetPan(const std::string& ip,
int32_t pan,
SetCallback callback) {
set_pan_call_count_++;
pan_ = pan;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), true));
}
void FakeIpPeripheralServiceClient::SetTilt(const std::string& ip,
int32_t tilt,
SetCallback callback) {
set_tilt_call_count_++;
tilt_ = tilt;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), true));
}
void FakeIpPeripheralServiceClient::SetZoom(const std::string& ip,
int32_t zoom,
SetCallback callback) {
set_zoom_call_count_++;
zoom_ = zoom;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), true));
}
} // namespace chromeos
// Copyright 2020 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_IP_PERIPHERAL_FAKE_IP_PERIPHERAL_SERVICE_CLIENT_H_
#define CHROMEOS_DBUS_IP_PERIPHERAL_FAKE_IP_PERIPHERAL_SERVICE_CLIENT_H_
#include <string>
#include "base/macros.h"
#include "chromeos/dbus/ip_peripheral/ip_peripheral_service_client.h"
namespace chromeos {
class COMPONENT_EXPORT(DBUS_IP_PERIPHERAL_CLIENT) FakeIpPeripheralServiceClient
: public IpPeripheralServiceClient {
public:
FakeIpPeripheralServiceClient();
FakeIpPeripheralServiceClient(const FakeIpPeripheralServiceClient&) = delete;
FakeIpPeripheralServiceClient& operator=(
const FakeIpPeripheralServiceClient&) = delete;
~FakeIpPeripheralServiceClient() override;
// Checks that FakeIpPeripheralServiceClient was initialized and returns it.
static FakeIpPeripheralServiceClient* Get();
// IpPeripheralServiceClient
void GetPan(const std::string& ip, GetCallback callback) override;
void GetTilt(const std::string& ip, GetCallback callback) override;
void GetZoom(const std::string& ip, GetCallback callback) override;
void SetPan(const std::string& ip,
int32_t pan,
SetCallback callback) override;
void SetTilt(const std::string& ip,
int32_t tilt,
SetCallback callback) override;
void SetZoom(const std::string& ip,
int32_t zoom,
SetCallback callback) override;
int get_pan_call_count() const { return get_pan_call_count_; }
int get_tilt_call_count() const { return get_tilt_call_count_; }
int get_zoom_call_count() const { return get_zoom_call_count_; }
int set_pan_call_count() const { return set_pan_call_count_; }
int set_tilt_call_count() const { return set_tilt_call_count_; }
int set_zoom_call_count() const { return set_zoom_call_count_; }
int32_t pan() const { return pan_; }
void set_pan(int32_t pan) { pan_ = pan; }
int32_t tilt() const { return tilt_; }
void set_tilt(int32_t tilt) { tilt_ = tilt; }
int32_t zoom() const { return zoom_; }
void set_zoom(int32_t zoom) { zoom_ = zoom; }
private:
int get_pan_call_count_ = 0;
int get_tilt_call_count_ = 0;
int get_zoom_call_count_ = 0;
int set_pan_call_count_ = 0;
int set_tilt_call_count_ = 0;
int set_zoom_call_count_ = 0;
int32_t pan_ = 0;
int32_t tilt_ = 0;
int32_t zoom_ = 0;
};
} // namespace chromeos
#endif // CHROMEOS_DBUS_IP_PERIPHERAL_FAKE_IP_PERIPHERAL_SERVICE_CLIENT_H_
// Copyright 2020 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/ip_peripheral/ip_peripheral_service_client.h"
#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/macros.h"
#include "chromeos/dbus/ip_peripheral/fake_ip_peripheral_service_client.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_proxy.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
namespace {
IpPeripheralServiceClient* g_instance = nullptr;
void OnGetMethod(IpPeripheralServiceClient::GetCallback callback,
dbus::Response* response) {
int32_t value = 0;
int32_t min = 0;
int32_t max = 0;
if (!response) {
LOG(ERROR) << "Unable to get pan/tilt/zoom value. Call failed, no response";
std::move(callback).Run(false, value, min, max);
return;
}
dbus::MessageReader reader(response);
if (!reader.PopInt32(&value)) {
LOG(ERROR) << "Unable to read pan/tilt/zoom value.";
std::move(callback).Run(false, value, min, max);
return;
}
if (!reader.PopInt32(&min)) {
LOG(ERROR) << "Unable to read pan/tilt/zoom min value.";
std::move(callback).Run(false, value, min, max);
return;
}
if (!reader.PopInt32(&max)) {
LOG(ERROR) << "Unable to read pan/tilt/zoom max value.";
std::move(callback).Run(false, value, min, max);
return;
}
std::move(callback).Run(true, value, min, max);
}
void OnSetMethod(IpPeripheralServiceClient::SetCallback callback,
dbus::Response* response) {
if (!response) {
LOG(ERROR) << "Unable to set pan/tilt/zoom value. Call failed, no response";
std::move(callback).Run(false);
return;
}
std::move(callback).Run(true);
}
// Real implementation of IpPeripheralServiceClient.
class IpPeripheralServiceClientImpl : public IpPeripheralServiceClient {
public:
IpPeripheralServiceClientImpl() = default;
IpPeripheralServiceClientImpl(const IpPeripheralServiceClientImpl&) = delete;
IpPeripheralServiceClientImpl& operator=(
const IpPeripheralServiceClientImpl&) = delete;
~IpPeripheralServiceClientImpl() override = default;
void GetPan(const std::string& ip, GetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kGetPanMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnGetMethod, std::move(callback)));
}
void GetTilt(const std::string& ip, GetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kGetTiltMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnGetMethod, std::move(callback)));
}
void GetZoom(const std::string& ip, GetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kGetZoomMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnGetMethod, std::move(callback)));
}
void SetPan(const std::string& ip,
int32_t pan,
SetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kSetPanMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
writer.AppendInt32(pan);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnSetMethod, std::move(callback)));
}
void SetTilt(const std::string& ip,
int32_t tilt,
SetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kSetTiltMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
writer.AppendInt32(tilt);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnSetMethod, std::move(callback)));
}
void SetZoom(const std::string& ip,
int32_t zoom,
SetCallback callback) override {
dbus::MethodCall method_call(ip_peripheral::kIpPeripheralServiceInterface,
ip_peripheral::kSetZoomMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendString(ip);
writer.AppendInt32(zoom);
ip_peripheral_service_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&OnSetMethod, std::move(callback)));
}
void Init(dbus::Bus* bus) {
ip_peripheral_service_proxy_ = bus->GetObjectProxy(
ip_peripheral::kIpPeripheralServiceName,
dbus::ObjectPath(ip_peripheral::kIpPeripheralServicePath));
}
private:
dbus::ObjectProxy* ip_peripheral_service_proxy_ = nullptr;
};
} // namespace
IpPeripheralServiceClient::IpPeripheralServiceClient() {
CHECK(!g_instance);
g_instance = this;
}
IpPeripheralServiceClient::~IpPeripheralServiceClient() {
CHECK_EQ(this, g_instance);
g_instance = nullptr;
}
// static
void IpPeripheralServiceClient::Initialize(dbus::Bus* bus) {
CHECK(bus);
(new IpPeripheralServiceClientImpl())->Init(bus);
}
// static
void IpPeripheralServiceClient::InitializeFake() {
new FakeIpPeripheralServiceClient();
}
// static
void IpPeripheralServiceClient::Shutdown() {
CHECK(g_instance);
delete g_instance;
}
// static
IpPeripheralServiceClient* IpPeripheralServiceClient::Get() {
return g_instance;
}
} // namespace chromeos
// Copyright 2020 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_IP_PERIPHERAL_IP_PERIPHERAL_SERVICE_CLIENT_H_
#define CHROMEOS_DBUS_IP_PERIPHERAL_IP_PERIPHERAL_SERVICE_CLIENT_H_
#include <memory>
#include <string>
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
namespace dbus {
class Bus;
} // namespace dbus
namespace chromeos {
// IpPeripheralServiceClient is used to communicate with the DBus interface
// (org.chromium.IpPeripheralService) exposed by the IP Peripheral service on
// Chrome OS devices that support IP-based cameras and other peripherals. The IP
// Peripheral service manages all communications with IP-based peripherals.
//
// All methods should be called from the origin thread (UI thread)
// which initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(DBUS_IP_PERIPHERAL_CLIENT) IpPeripheralServiceClient {
public:
IpPeripheralServiceClient(const IpPeripheralServiceClient&) = delete;
IpPeripheralServiceClient& operator=(IpPeripheralServiceClient&) = delete;
// Callback for the pan/tilt/zoom getter functions.
using GetCallback = base::OnceCallback<
void(bool success, int32_t value, int32_t min, int32_t max)>;
// Callback for the pan/tilt/zoom setter functions.
using SetCallback = base::OnceCallback<void(bool success)>;
// Creates and initializes the global instance. |bus| must not be null.
static void Initialize(dbus::Bus* bus);
// Creates and initialize a fake global instance if not already created.
static void InitializeFake();
// Destroys the global instance.
static void Shutdown();
// Returns the global instance which may be null if not initialized.
static IpPeripheralServiceClient* Get();
// Getters for pan/tilt/zoom values for an IP camera. The first argument is
// the IP address of the camera. The callback returns whether or not the call
// succeeded, the current value, the minimimum possible value, and the maximum
// possible value.
virtual void GetPan(const std::string& ip, GetCallback callback) = 0;
virtual void GetTilt(const std::string& ip, GetCallback callback) = 0;
virtual void GetZoom(const std::string& ip, GetCallback callback) = 0;
// Setters for pan/tilt/zoom values for an IP camera. Arguments are the IP
// address of the camera and the pan/tilt/zoom value to be set. The callback
// returns whether or not the call succeeded. Use the corresponding getter
// function above to discover the range of valid values.
virtual void SetPan(const std::string& ip,
int32_t pan,
SetCallback callback) = 0;
virtual void SetTilt(const std::string& ip,
int32_t tilt,
SetCallback callback) = 0;
virtual void SetZoom(const std::string& ip,
int32_t zoom,
SetCallback callback) = 0;
protected:
// Initialize/Shutdown should be used instead.
IpPeripheralServiceClient();
virtual ~IpPeripheralServiceClient();
};
} // namespace chromeos
#endif // CHROMEOS_DBUS_IP_PERIPHERAL_IP_PERIPHERAL_SERVICE_CLIENT_H_
// Copyright 2020 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/ip_peripheral/ip_peripheral_service_client.h"
#include <memory>
#include <string>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_object_proxy.h"
#include "dbus/object_path.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
using ::testing::_;
using ::testing::Return;
namespace chromeos {
namespace {
// Matcher that verifies that a dbus::Message has member |name|.
MATCHER_P(HasMember, name, "") {
if (arg->GetMember() != name) {
*result_listener << "has member " << arg->GetMember();
return false;
}
return true;
}
} // namespace
class IpPeripheralServiceClientTest : public testing::Test {
public:
IpPeripheralServiceClientTest() = default;
~IpPeripheralServiceClientTest() override = default;
void SetUp() override {
dbus::Bus::Options options;
options.bus_type = dbus::Bus::SYSTEM;
// Suppress warnings about uninteresting calls to the bus.
mock_bus_ = base::MakeRefCounted<::testing::NiceMock<dbus::MockBus>>(
dbus::Bus::Options());
// Setup mock bus and proxy.
mock_proxy_ = base::MakeRefCounted<dbus::MockObjectProxy>(
mock_bus_.get(), ip_peripheral::kIpPeripheralServiceName,
dbus::ObjectPath(ip_peripheral::kIpPeripheralServicePath));
ON_CALL(*mock_bus_.get(),
GetObjectProxy(
ip_peripheral::kIpPeripheralServiceName,
dbus::ObjectPath(ip_peripheral::kIpPeripheralServicePath)))
.WillByDefault(Return(mock_proxy_.get()));
// Create a client with the mock bus.
IpPeripheralServiceClient::Initialize(mock_bus_.get());
client_ = IpPeripheralServiceClient::Get();
// Run the message loop to run the signal connection result callback.
base::RunLoop().RunUntilIdle();
}
void TearDown() override { IpPeripheralServiceClient::Shutdown(); }
protected:
base::test::SingleThreadTaskEnvironment task_environment_;
IpPeripheralServiceClient* client_ = nullptr;
scoped_refptr<dbus::MockBus> mock_bus_;
scoped_refptr<dbus::MockObjectProxy> mock_proxy_;
};
TEST_F(IpPeripheralServiceClientTest, GetPanDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kGetPanMethod), _, _));
client_->GetPan("", base::DoNothing());
base::RunLoop().RunUntilIdle();
}
TEST_F(IpPeripheralServiceClientTest, GetTiltDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kGetTiltMethod), _, _));
client_->GetTilt("", base::DoNothing());
base::RunLoop().RunUntilIdle();
}
TEST_F(IpPeripheralServiceClientTest, GetZoomDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kGetZoomMethod), _, _));
client_->GetZoom("", base::DoNothing());
base::RunLoop().RunUntilIdle();
}
TEST_F(IpPeripheralServiceClientTest, SetPanDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kSetPanMethod), _, _));
client_->SetPan("", 0, base::DoNothing());
base::RunLoop().RunUntilIdle();
}
TEST_F(IpPeripheralServiceClientTest, SetTiltDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kSetTiltMethod), _, _));
client_->SetTilt("", 0, base::DoNothing());
base::RunLoop().RunUntilIdle();
}
TEST_F(IpPeripheralServiceClientTest, SetZoomDBusMessage) {
EXPECT_CALL(*mock_proxy_.get(),
DoCallMethod(HasMember(ip_peripheral::kSetZoomMethod), _, _));
client_->SetZoom("", 0, base::DoNothing());
base::RunLoop().RunUntilIdle();
}
} // namespace chromeos
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment