Commit bcd90ba9 authored by Jan Wilken Doerrie's avatar Jan Wilken Doerrie Committed by Commit Bot

[Bluetooth][WinRT] Add FakeDeviceWatcher Skeleton

This change adds a skeleton for a fake implementation of IDeviceWatcher.
No functionality is added yet, this will be done in a follow-up CL.

Bug: 821766
Change-Id: If51716beac17543975d42632b17c8af7f269ac5c
Reviewed-on: https://chromium-review.googlesource.com/1193890Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587531}
parent a26e58c0
......@@ -316,6 +316,8 @@ test("device_unittests") {
"bluetooth/test/fake_device_pairing_requested_event_args_winrt.h",
"bluetooth/test/fake_device_pairing_result_winrt.cc",
"bluetooth/test/fake_device_pairing_result_winrt.h",
"bluetooth/test/fake_device_watcher_winrt.cc",
"bluetooth/test/fake_device_watcher_winrt.h",
"bluetooth/test/fake_gatt_characteristic_winrt.cc",
"bluetooth/test/fake_gatt_characteristic_winrt.h",
"bluetooth/test/fake_gatt_characteristics_result_winrt.cc",
......
// Copyright 2018 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/bluetooth/test/fake_device_watcher_winrt.h"
namespace device {
namespace {
using ABI::Windows::Devices::Enumeration::DeviceInformation;
using ABI::Windows::Devices::Enumeration::DeviceInformationUpdate;
using ABI::Windows::Devices::Enumeration::DeviceWatcher;
using ABI::Windows::Devices::Enumeration::DeviceWatcherStatus;
using ABI::Windows::Foundation::ITypedEventHandler;
} // namespace
FakeDeviceWatcherWinrt::FakeDeviceWatcherWinrt() = default;
FakeDeviceWatcherWinrt::~FakeDeviceWatcherWinrt() = default;
HRESULT FakeDeviceWatcherWinrt::add_Added(
ITypedEventHandler<DeviceWatcher*, DeviceInformation*>* handler,
EventRegistrationToken* token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::remove_Added(EventRegistrationToken token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::add_Updated(
ITypedEventHandler<DeviceWatcher*, DeviceInformationUpdate*>* handler,
EventRegistrationToken* token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::remove_Updated(EventRegistrationToken token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::add_Removed(
ITypedEventHandler<DeviceWatcher*, DeviceInformationUpdate*>* handler,
EventRegistrationToken* token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::remove_Removed(EventRegistrationToken token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::add_EnumerationCompleted(
ITypedEventHandler<DeviceWatcher*, IInspectable*>* handler,
EventRegistrationToken* token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::remove_EnumerationCompleted(
EventRegistrationToken token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::add_Stopped(
ITypedEventHandler<DeviceWatcher*, IInspectable*>* handler,
EventRegistrationToken* token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::remove_Stopped(EventRegistrationToken token) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::get_Status(DeviceWatcherStatus* status) {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::Start() {
return E_NOTIMPL;
}
HRESULT FakeDeviceWatcherWinrt::Stop() {
return E_NOTIMPL;
}
} // namespace device
// Copyright 2018 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 DEVICE_BLUETOOTH_TEST_FAKE_DEVICE_WATCHER_WINRT_H_
#define DEVICE_BLUETOOTH_TEST_FAKE_DEVICE_WATCHER_WINRT_H_
#include <windows.devices.enumeration.h>
#include <windows.foundation.h>
#include <wrl/implements.h>
#include "base/macros.h"
namespace device {
class FakeDeviceWatcherWinrt
: public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<
Microsoft::WRL::WinRt | Microsoft::WRL::InhibitRoOriginateError>,
ABI::Windows::Devices::Enumeration::IDeviceWatcher> {
public:
FakeDeviceWatcherWinrt();
~FakeDeviceWatcherWinrt() override;
// IDeviceWatcher:
IFACEMETHODIMP add_Added(
ABI::Windows::Foundation::ITypedEventHandler<
ABI::Windows::Devices::Enumeration::DeviceWatcher*,
ABI::Windows::Devices::Enumeration::DeviceInformation*>* handler,
EventRegistrationToken* token) override;
IFACEMETHODIMP remove_Added(EventRegistrationToken token) override;
IFACEMETHODIMP add_Updated(
ABI::Windows::Foundation::ITypedEventHandler<
ABI::Windows::Devices::Enumeration::DeviceWatcher*,
ABI::Windows::Devices::Enumeration::DeviceInformationUpdate*>*
handler,
EventRegistrationToken* token) override;
IFACEMETHODIMP remove_Updated(EventRegistrationToken token) override;
IFACEMETHODIMP add_Removed(
ABI::Windows::Foundation::ITypedEventHandler<
ABI::Windows::Devices::Enumeration::DeviceWatcher*,
ABI::Windows::Devices::Enumeration::DeviceInformationUpdate*>*
handler,
EventRegistrationToken* token) override;
IFACEMETHODIMP remove_Removed(EventRegistrationToken token) override;
IFACEMETHODIMP add_EnumerationCompleted(
ABI::Windows::Foundation::ITypedEventHandler<
ABI::Windows::Devices::Enumeration::DeviceWatcher*,
IInspectable*>* handler,
EventRegistrationToken* token) override;
IFACEMETHODIMP remove_EnumerationCompleted(
EventRegistrationToken token) override;
IFACEMETHODIMP add_Stopped(
ABI::Windows::Foundation::ITypedEventHandler<
ABI::Windows::Devices::Enumeration::DeviceWatcher*,
IInspectable*>* handler,
EventRegistrationToken* token) override;
IFACEMETHODIMP remove_Stopped(EventRegistrationToken token) override;
IFACEMETHODIMP get_Status(
ABI::Windows::Devices::Enumeration::DeviceWatcherStatus* status) override;
IFACEMETHODIMP Start() override;
IFACEMETHODIMP Stop() override;
private:
DISALLOW_COPY_AND_ASSIGN(FakeDeviceWatcherWinrt);
};
} // namespace device
#endif // DEVICE_BLUETOOTH_TEST_FAKE_DEVICE_WATCHER_WINRT_H_
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