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

Side by Side Diff: device/usb/mock_usb_device_handle.h

Issue 1144493003: Extract //device/usb mocks so that they can be shared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android and GN builds for real. Created 5 years, 7 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/usb/mock_usb_device.cc ('k') | device/usb/mock_usb_device_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #ifndef DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
6 #define DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
7
8 #include "device/usb/usb_device_handle.h"
9
10 #include "testing/gmock/include/gmock/gmock.h"
11
12 namespace device {
13
14 class MockUsbDeviceHandle : public UsbDeviceHandle {
15 public:
16 MockUsbDeviceHandle(UsbDevice* device);
17
18 MOCK_METHOD0(Close, void());
19 MOCK_METHOD10(ControlTransfer,
20 void(UsbEndpointDirection direction,
21 TransferRequestType request_type,
22 TransferRecipient recipient,
23 uint8 request,
24 uint16 value,
25 uint16 index,
26 scoped_refptr<net::IOBuffer> buffer,
27 size_t length,
28 unsigned int timeout,
29 const TransferCallback& callback));
30 MOCK_METHOD6(BulkTransfer,
31 void(UsbEndpointDirection direction,
32 uint8 endpoint,
33 scoped_refptr<net::IOBuffer> buffer,
34 size_t length,
35 unsigned int timeout,
36 const TransferCallback& callback));
37 MOCK_METHOD6(InterruptTransfer,
38 void(UsbEndpointDirection direction,
39 uint8 endpoint,
40 scoped_refptr<net::IOBuffer> buffer,
41 size_t length,
42 unsigned int timeout,
43 const TransferCallback& callback));
44 MOCK_METHOD8(IsochronousTransfer,
45 void(UsbEndpointDirection direction,
46 uint8 endpoint,
47 scoped_refptr<net::IOBuffer> buffer,
48 size_t length,
49 unsigned int packets,
50 unsigned int packet_length,
51 unsigned int timeout,
52 const TransferCallback& callback));
53 MOCK_METHOD1(ResetDevice, void(const ResultCallback& callback));
54 MOCK_METHOD2(GetStringDescriptor, bool(uint8_t, base::string16*));
55 MOCK_METHOD2(SetConfiguration,
56 void(int configuration_value, const ResultCallback& callback));
57 MOCK_METHOD2(ClaimInterface,
58 void(int interface_number, const ResultCallback& callback));
59 MOCK_METHOD1(ReleaseInterface, bool(int interface_number));
60 MOCK_METHOD3(SetInterfaceAlternateSetting,
61 void(int interface_number,
62 int alternate_setting,
63 const ResultCallback& callback));
64
65 scoped_refptr<UsbDevice> GetDevice() const override;
66
67 private:
68 ~MockUsbDeviceHandle() override;
69
70 UsbDevice* device_;
71 };
72
73 } // namespace device
74
75 #endif // DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
OLDNEW
« no previous file with comments | « device/usb/mock_usb_device.cc ('k') | device/usb/mock_usb_device_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698