Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / device / test / usb_test_gadget.h
blob1c835e2ec4f2f33a837063895e8b1187f1eea81c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_
6 #define DEVICE_TEST_USB_TEST_GADGET_H_
8 #include <string>
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
13 namespace usb_service {
14 class UsbDevice;
15 } // namespace usb_service
17 namespace device {
19 class UsbTestGadget {
20 public:
21 enum Type {
22 DEFAULT = 0,
23 KEYBOARD,
24 MOUSE,
25 HID_ECHO,
28 virtual ~UsbTestGadget() {}
30 static bool IsTestEnabled();
31 static scoped_ptr<UsbTestGadget> Claim();
33 virtual bool Unclaim() = 0;
34 virtual bool Disconnect() = 0;
35 virtual bool Reconnect() = 0;
36 virtual bool SetType(Type type) = 0;
38 virtual usb_service::UsbDevice* GetDevice() const = 0;
39 virtual std::string GetSerial() const = 0;
41 protected:
42 UsbTestGadget() {}
44 private:
45 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget);
48 } // namespace device
50 #endif // DEVICE_TEST_USB_TEST_GADGET_H_