summaryrefslogtreecommitdiffstats
path: root/device/hid/mock_hid_service.h
blob: f5f6c82df11966196ac30a3891df1e5f623ff5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// 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.

#ifndef DEVICE_HID_MOCK_HID_SERVICE_H_
#define DEVICE_HID_MOCK_HID_SERVICE_H_

#include <map>

#include "device/hid/hid_service.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace device {

class MockHidService : public HidService {
 public:
  MockHidService();
  ~MockHidService() override;

  // Public wrappers around protected functions needed for tests.
  void AddDevice(scoped_refptr<HidDeviceInfo> info);
  void RemoveDevice(const HidDeviceId& device_id);
  void FirstEnumerationComplete();
  const std::map<HidDeviceId, scoped_refptr<HidDeviceInfo>>& devices() const;

  MOCK_METHOD2(Connect,
               void(const HidDeviceId& device_id,
                    const ConnectCallback& callback));
};

}  // namespace device

#endif  // DEVICE_HID_MOCK_HID_SERVICE_H_