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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/mock_usb_device_handle.h
diff --git a/device/usb/mock_usb_device_handle.h b/device/usb/mock_usb_device_handle.h
new file mode 100644
index 0000000000000000000000000000000000000000..61a544275c49cabee97df35786850deb78f09bd4
--- /dev/null
+++ b/device/usb/mock_usb_device_handle.h
@@ -0,0 +1,75 @@
+// 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_DEVICE_HANDLE_H_
+#define DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
+
+#include "device/usb/usb_device_handle.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace device {
+
+class MockUsbDeviceHandle : public UsbDeviceHandle {
+ public:
+ MockUsbDeviceHandle(UsbDevice* device);
+
+ MOCK_METHOD0(Close, void());
+ MOCK_METHOD10(ControlTransfer,
+ void(UsbEndpointDirection direction,
+ TransferRequestType request_type,
+ TransferRecipient recipient,
+ uint8 request,
+ uint16 value,
+ uint16 index,
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t length,
+ unsigned int timeout,
+ const TransferCallback& callback));
+ MOCK_METHOD6(BulkTransfer,
+ void(UsbEndpointDirection direction,
+ uint8 endpoint,
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t length,
+ unsigned int timeout,
+ const TransferCallback& callback));
+ MOCK_METHOD6(InterruptTransfer,
+ void(UsbEndpointDirection direction,
+ uint8 endpoint,
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t length,
+ unsigned int timeout,
+ const TransferCallback& callback));
+ MOCK_METHOD8(IsochronousTransfer,
+ void(UsbEndpointDirection direction,
+ uint8 endpoint,
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t length,
+ unsigned int packets,
+ unsigned int packet_length,
+ unsigned int timeout,
+ const TransferCallback& callback));
+ MOCK_METHOD1(ResetDevice, void(const ResultCallback& callback));
+ MOCK_METHOD2(GetStringDescriptor, bool(uint8_t, base::string16*));
+ MOCK_METHOD2(SetConfiguration,
+ void(int configuration_value, const ResultCallback& callback));
+ MOCK_METHOD2(ClaimInterface,
+ void(int interface_number, const ResultCallback& callback));
+ MOCK_METHOD1(ReleaseInterface, bool(int interface_number));
+ MOCK_METHOD3(SetInterfaceAlternateSetting,
+ void(int interface_number,
+ int alternate_setting,
+ const ResultCallback& callback));
+
+ scoped_refptr<UsbDevice> GetDevice() const override;
+
+ private:
+ ~MockUsbDeviceHandle() override;
+
+ UsbDevice* device_;
+};
+
+} // namespace device
+
+#endif // DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
« 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