| Index: device/test/test_device_client.cc
|
| diff --git a/device/test/test_device_client.cc b/device/test/test_device_client.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fcfbf9285b7290f012919107200b97a4462308a8
|
| --- /dev/null
|
| +++ b/device/test/test_device_client.cc
|
| @@ -0,0 +1,35 @@
|
| +// Copyright 2015 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 "device/test/test_device_client.h"
|
| +
|
| +#include "device/hid/hid_service.h"
|
| +#include "device/usb/usb_service.h"
|
| +
|
| +namespace device {
|
| +
|
| +TestDeviceClient::TestDeviceClient(
|
| + scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner)
|
| + : blocking_task_runner_(blocking_task_runner) {}
|
| +
|
| +TestDeviceClient::~TestDeviceClient() {}
|
| +
|
| +HidService* TestDeviceClient::GetHidService() {
|
| +#if !defined(OS_LINUX) || defined(USE_UDEV)
|
| + return HidService::GetInstance(blocking_task_runner_);
|
| +#else
|
| + return nullptr;
|
| +#endif
|
| +}
|
| +
|
| +UsbService* TestDeviceClient::GetUsbService() {
|
| +#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
| + if (!usb_service_) {
|
| + usb_service_ = UsbService::Create(blocking_task_runner_);
|
| + }
|
| +#endif
|
| + return usb_service_.get();
|
| +}
|
| +
|
| +} // namespace device
|
|
|