summaryrefslogtreecommitdiffstats
path: root/device/usb/mock_usb_service.h
blob: e0fbe53df85fa1740b10d447a4150add853adcf2 (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
// 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_USB_MOCK_USB_SERVICE_H_
#define DEVICE_USB_MOCK_USB_SERVICE_H_

#include "device/usb/usb_service.h"

#include "testing/gmock/include/gmock/gmock.h"

namespace device {

class MockUsbService : public UsbService {
 public:
  MockUsbService();
  ~MockUsbService() override;

  void AddDevice(scoped_refptr<UsbDevice> device);
  void RemoveDevice(scoped_refptr<UsbDevice> device);

 protected:
  // UsbService implementation:
  scoped_refptr<UsbDevice> GetDevice(const std::string& guid) override;
  void GetDevices(const GetDevicesCallback& callback) override;

  std::map<std::string, scoped_refptr<UsbDevice>> devices_;
};

}  // namespace device

#endif  // DEVICE_USB_MOCK_USB_SERVICE_H_