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

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

Issue 1468423003: Construct USB descriptors over explicit values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Android code. Created 4 years, 10 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/usb_interface_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_apitest.cc
diff --git a/extensions/browser/api/usb/usb_apitest.cc b/extensions/browser/api/usb/usb_apitest.cc
index 30601a9fb5390225de575f07e7f764a2bf53516e..887ae2170fb1bf9429499f04ce2b6db4d7292784 100644
--- a/extensions/browser/api/usb/usb_apitest.cc
+++ b/extensions/browser/api/usb/usb_apitest.cc
@@ -127,11 +127,8 @@ class UsbApiTest : public ShellApiTest {
device_client_.reset(new MockDeviceClient());
std::vector<UsbConfigDescriptor> configs;
- UsbConfigDescriptor config;
- config.configuration_value = 1;
- configs.push_back(config);
- config.configuration_value = 2;
- configs.push_back(config);
+ configs.emplace_back(1, false, false, 0);
+ configs.emplace_back(2, false, false, 0);
mock_device_ = new MockUsbDevice(0, 0, "Test Manufacturer", "Test Device",
"ABC123", configs);
@@ -168,7 +165,7 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, ResetDevice) {
}
IN_PROC_BROWSER_TEST_F(UsbApiTest, SetConfiguration) {
- UsbConfigDescriptor config_descriptor;
+ UsbConfigDescriptor config_descriptor(1, false, false, 0);
EXPECT_CALL(*mock_device_handle_.get(), SetConfiguration(1, _))
.WillOnce(InvokeCallback<1>(true));
EXPECT_CALL(*mock_device_handle_.get(), Close()).Times(1);
@@ -179,7 +176,7 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, SetConfiguration) {
}
IN_PROC_BROWSER_TEST_F(UsbApiTest, ListInterfaces) {
- UsbConfigDescriptor config_descriptor;
+ UsbConfigDescriptor config_descriptor(1, false, false, 0);
EXPECT_CALL(*mock_device_handle_.get(), Close()).Times(1);
EXPECT_CALL(*mock_device_.get(), GetActiveConfiguration())
.WillOnce(Return(&config_descriptor));
« no previous file with comments | « device/usb/usb_interface_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698