summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authorreillyg@chromium.org <reillyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 12:09:54 +0000
committerreillyg@chromium.org <reillyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 12:11:22 +0000
commitcc3dd4244d3496e7f1d28d66ff39bdb2dd8e678c (patch)
tree1d5813fcd6533cb5505532a1532403491f74bf73 /device
parentae47a8facfc50e5d16442269051c497dcb431a1a (diff)
downloadchromium_src-cc3dd4244d3496e7f1d28d66ff39bdb2dd8e678c.zip
chromium_src-cc3dd4244d3496e7f1d28d66ff39bdb2dd8e678c.tar.gz
chromium_src-cc3dd4244d3496e7f1d28d66ff39bdb2dd8e678c.tar.bz2
Add chrome.usbPrivate API for use by USB device WEBUI.
This private API exposes more information about connected USB devices than the public chrome.usb API. It is designed for use by WEBUI components that wish to display information about connected to devices to the user such as the dialog box shown by the proposed chrome.usb.getUserSelectedDevices API. BUG=346953 Review URL: https://codereview.chromium.org/463493006 Cr-Commit-Position: refs/heads/master@{#289530} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device')
-rw-r--r--device/usb/usb_service_unittest.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/device/usb/usb_service_unittest.cc b/device/usb/usb_service_unittest.cc
index 79a5bb7..1f8b8e2 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) {