summaryrefslogtreecommitdiffstats
path: root/device/usb/mock_usb_device_handle.h
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2016-02-01 16:56:15 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-02 00:58:06 +0000
commit051c98e9d3e843295d659b5676fcfa9dc1be5da6 (patch)
tree54414ed43e166fb91bcfb3d6413157ad9cf27fe6 /device/usb/mock_usb_device_handle.h
parentea6d840e4d96f6df739f55a89ccf69daa3569a77 (diff)
downloadchromium_src-051c98e9d3e843295d659b5676fcfa9dc1be5da6.zip
chromium_src-051c98e9d3e843295d659b5676fcfa9dc1be5da6.tar.gz
chromium_src-051c98e9d3e843295d659b5676fcfa9dc1be5da6.tar.bz2
Update device/usb and its Mojo interface for variable size ISO packets.
To support the WebUSB API our underlying USB library needs to support isochronous transfers with full control over the packet size. We also need to know the completion status of each packet which was previously not available. This patch updates the interface to match that provided by libusb and the underlying platform specific APIs. BUG=492204 Review URL: https://codereview.chromium.org/1618393004 Cr-Commit-Position: refs/heads/master@{#372844}
Diffstat (limited to 'device/usb/mock_usb_device_handle.h')
-rw-r--r--device/usb/mock_usb_device_handle.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/device/usb/mock_usb_device_handle.h b/device/usb/mock_usb_device_handle.h
index 372068c..26e6190 100644
--- a/device/usb/mock_usb_device_handle.h
+++ b/device/usb/mock_usb_device_handle.h
@@ -5,11 +5,12 @@
#ifndef DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
#define DEVICE_USB_MOCK_USB_DEVICE_HANDLE_H_
-#include "device/usb/usb_device_handle.h"
-
#include <stddef.h>
#include <stdint.h>
+#include <vector>
+
+#include "device/usb/usb_device_handle.h"
#include "net/base/io_buffer.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -17,7 +18,7 @@ namespace device {
class MockUsbDeviceHandle : public UsbDeviceHandle {
public:
- MockUsbDeviceHandle(UsbDevice* device);
+ explicit MockUsbDeviceHandle(UsbDevice* device);
scoped_refptr<UsbDevice> GetDevice() const override;
MOCK_METHOD0(Close, void());
@@ -44,15 +45,17 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
size_t length,
unsigned int timeout,
const TransferCallback& callback));
- MOCK_METHOD8(IsochronousTransfer,
- void(UsbEndpointDirection direction,
- uint8_t endpoint,
+ MOCK_METHOD4(IsochronousTransferIn,
+ void(uint8_t endpoint,
+ const std::vector<uint32_t>& packet_lengths,
+ unsigned int timeout,
+ const IsochronousTransferCallback& callback));
+ MOCK_METHOD5(IsochronousTransferOut,
+ void(uint8_t endpoint,
scoped_refptr<net::IOBuffer> buffer,
- size_t length,
- unsigned int packets,
- unsigned int packet_length,
+ const std::vector<uint32_t>& packet_lengths,
unsigned int timeout,
- const TransferCallback& callback));
+ const IsochronousTransferCallback& callback));
MOCK_METHOD6(GenericTransfer,
void(UsbEndpointDirection direction,
uint8_t endpoint,