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

Unified Diff: device/usb/usb_ids_unittest.cc

Issue 11344039: Adding USB ID vendor and product lookups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding OWNERS Created 8 years 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_ids.cc ('k') | tools/usb_ids/usb_ids.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_ids_unittest.cc
diff --git a/device/usb/usb_ids_unittest.cc b/device/usb/usb_ids_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..decce1e703f3d9ef0536a6214bb1f4453ef8b528
--- /dev/null
+++ b/device/usb/usb_ids_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "device/usb/usb_ids.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+static const uint16_t kGoogleVendorId = 0x18d1;
+static const uint16_t kNexusSProductId = 0x4e21;
+
+} // namespace
+
+namespace device {
+
+TEST(UsbIdsTest, GetVendorName) {
+ EXPECT_EQ(NULL, UsbIds::GetVendorName(0));
+ EXPECT_EQ(std::string("Google Inc."), UsbIds::GetVendorName(kGoogleVendorId));
+}
+
+TEST(UsbIdsTest, GetProductName) {
+ EXPECT_EQ(NULL, UsbIds::GetProductName(0, 0));
+ EXPECT_EQ(NULL, UsbIds::GetProductName(kGoogleVendorId, 0));
+ EXPECT_EQ(std::string("Nexus S"), UsbIds::GetProductName(kGoogleVendorId,
+ kNexusSProductId));
+}
+
+} // namespace device
« no previous file with comments | « device/usb/usb_ids.cc ('k') | tools/usb_ids/usb_ids.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698