Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: device/test/usb_test_gadget.h

Issue 423473008: [usb_gadget p13] Replace LUFA with UsbTestGadget in HidConnection tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/test/usb_test_gadget_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_ 5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_
6 #define DEVICE_TEST_USB_TEST_GADGET_H_ 6 #define DEVICE_TEST_USB_TEST_GADGET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace usb_service { 13 namespace usb_service {
14 class UsbDevice; 14 class UsbDevice;
15 } // namespace usb_service 15 } // namespace usb_service
16 16
17 namespace device { 17 namespace device {
18 18
19 class UsbTestGadget { 19 class UsbTestGadget {
20 public: 20 public:
21 enum Type { 21 enum Type {
22 DEFAULT = 0, 22 DEFAULT = 0,
23 KEYBOARD, 23 KEYBOARD,
24 MOUSE, 24 MOUSE,
25 HID_ECHO,
25 }; 26 };
26 27
27 virtual ~UsbTestGadget() {} 28 virtual ~UsbTestGadget() {}
28 29
29 static bool IsTestEnabled(); 30 static bool IsTestEnabled();
30 static scoped_ptr<UsbTestGadget> Claim(); 31 static scoped_ptr<UsbTestGadget> Claim();
31 32
32 virtual bool Unclaim() = 0; 33 virtual bool Unclaim() = 0;
33 virtual bool Disconnect() = 0; 34 virtual bool Disconnect() = 0;
34 virtual bool Reconnect() = 0; 35 virtual bool Reconnect() = 0;
35 virtual bool SetType(Type type) = 0; 36 virtual bool SetType(Type type) = 0;
36 37
37 virtual usb_service::UsbDevice* GetDevice() const = 0; 38 virtual usb_service::UsbDevice* GetDevice() const = 0;
38 virtual std::string GetSerial() const = 0; 39 virtual std::string GetSerial() const = 0;
39 40
40 protected: 41 protected:
41 UsbTestGadget() {} 42 UsbTestGadget() {}
42 43
43 private: 44 private:
44 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget); 45 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget);
45 }; 46 };
46 47
47 } // namespace device 48 } // namespace device
48 49
49 #endif // DEVICE_TEST_USB_TEST_GADGET_H_ 50 #endif // DEVICE_TEST_USB_TEST_GADGET_H_
OLDNEW
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/test/usb_test_gadget_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698