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

Unified Diff: device/usb/mock_usb_device_handle.h

Issue 1369643002: Add configuration and interface permission checks to DeviceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new method ot Android USB mocks. Created 5 years, 3 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
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
index c3742b329df22d87c87f383e67469ecd32280ef9..30b23d959c46863cdba9e25be51dacf62d675bd1 100644
--- a/device/usb/mock_usb_device_handle.h
+++ b/device/usb/mock_usb_device_handle.h
@@ -15,7 +15,19 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
public:
MockUsbDeviceHandle(UsbDevice* device);
+ scoped_refptr<UsbDevice> GetDevice() const override;
MOCK_METHOD0(Close, void());
+ 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));
+ MOCK_METHOD1(ResetDevice, void(const ResultCallback& callback));
+ MOCK_METHOD2(ClearHalt, void(uint8 endpoint, const ResultCallback& callback));
MOCK_METHOD10(ControlTransfer,
void(UsbEndpointDirection direction,
TransferRequestType request_type,
@@ -43,21 +55,8 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
size_t 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));
- MOCK_METHOD2(ClearHalt,
- void(uint8_t endpoint, const ResultCallback& callback));
-
- scoped_refptr<UsbDevice> GetDevice() const override;
+ MOCK_METHOD2(FindInterfaceByEndpoint,
+ bool(uint8_t endpoint_address, uint8_t* interface_number));
private:
~MockUsbDeviceHandle() override;

Powered by Google App Engine
This is Rietveld 408576698