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

Unified Diff: chrome/browser/extensions/api/usb/usb_apitest.cc

Issue 22914023: Introducing chrome.usb.getDevices/openDevice API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-interface
Patch Set: Fixes Created 7 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: chrome/browser/extensions/api/usb/usb_apitest.cc
diff --git a/chrome/browser/extensions/api/usb/usb_apitest.cc b/chrome/browser/extensions/api/usb/usb_apitest.cc
index 8fa2621124db4822836c8cb8e1654910c1292b7b..d5dc252840213fb5ae027b4ffffd1eee641419be 100644
--- a/chrome/browser/extensions/api/usb/usb_apitest.cc
+++ b/chrome/browser/extensions/api/usb/usb_apitest.cc
@@ -96,7 +96,7 @@ class UsbApiTest : public ExtensionApiTest {
virtual void SetUpOnMainThread() OVERRIDE {
mock_device_handle_ = new MockUsbDeviceHandle();
mock_device_ = new MockUsbDevice(mock_device_handle_.get());
- extensions::UsbFindDevicesFunction::SetDeviceForTest(mock_device_.get());
+ extensions::UsbGetDevicesFunction::SetDeviceForTest(mock_device_.get());
}
protected:
@@ -107,14 +107,19 @@ class UsbApiTest : public ExtensionApiTest {
} // namespace
IN_PROC_BROWSER_TEST_F(UsbApiTest, DeviceHandling) {
- EXPECT_CALL(*mock_device_handle_.get(), Close()).Times(AnyNumber());
+ EXPECT_CALL(*mock_device_handle_.get(), Close()).Times(4);
+ ASSERT_TRUE(RunExtensionTest("usb/device_handling"));
+}
+
+IN_PROC_BROWSER_TEST_F(UsbApiTest, ResetDevice) {
+ EXPECT_CALL(*mock_device_handle_.get(), Close()).Times(2);
EXPECT_CALL(*mock_device_handle_.get(), ResetDevice())
.WillOnce(Return(true))
.WillOnce(Return(false));
EXPECT_CALL(*mock_device_handle_.get(),
InterruptTransfer(USB_DIRECTION_OUTBOUND, 2, _, 1, _, _))
.WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_COMPLETED));
- ASSERT_TRUE(RunExtensionTest("usb/device_handling"));
+ ASSERT_TRUE(RunExtensionTest("usb/reset_device"));
}
IN_PROC_BROWSER_TEST_F(UsbApiTest, ListInterfaces) {

Powered by Google App Engine
This is Rietveld 408576698