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

Unified Diff: device/usb/usb_service_unittest.cc

Issue 463493006: Add chrome.usbPrivate API for use by USB device WEBUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change "Google Inc." to "Test Manufacturer". Created 6 years, 4 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 | « components/usb_service/usb_device_handle_impl.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service_unittest.cc
diff --git a/device/usb/usb_service_unittest.cc b/device/usb/usb_service_unittest.cc
index 79a5bb74925bb89f91df221758006a78a5aa7466..1f8b8e2c36606fb5a010ed15d8c7d43119df1e04 100644
--- a/device/usb/usb_service_unittest.cc
+++ b/device/usb/usb_service_unittest.cc
@@ -32,9 +32,22 @@ TEST_F(UsbServiceTest, ClaimGadget) {
ASSERT_TRUE(gadget.get());
scoped_refptr<UsbDeviceHandle> handle = gadget->GetDevice()->Open();
- base::string16 serial_utf16;
- ASSERT_TRUE(handle->GetSerial(&serial_utf16));
- ASSERT_EQ(gadget->GetSerial(), base::UTF16ToUTF8(serial_utf16));
+
+ base::string16 utf16;
+ ASSERT_TRUE(handle->GetManufacturer(&utf16));
+ ASSERT_EQ("Google Inc.", base::UTF16ToUTF8(utf16));
+ // Check again to make sure string descriptor caching works.
+ ASSERT_EQ("Google Inc.", base::UTF16ToUTF8(utf16));
+
+ ASSERT_TRUE(handle->GetProduct(&utf16));
+ ASSERT_EQ("Test Gadget (default state)", base::UTF16ToUTF8(utf16));
+ // Check again to make sure string descriptor caching works.
+ ASSERT_EQ("Test Gadget (default state)", base::UTF16ToUTF8(utf16));
+
+ ASSERT_TRUE(handle->GetSerial(&utf16));
+ ASSERT_EQ(gadget->GetSerial(), base::UTF16ToUTF8(utf16));
+ // Check again to make sure string descriptor caching works.
+ ASSERT_EQ(gadget->GetSerial(), base::UTF16ToUTF8(utf16));
}
TEST_F(UsbServiceTest, DisconnectAndReconnect) {
« no previous file with comments | « components/usb_service/usb_device_handle_impl.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698