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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « device/usb/usb_ids.cc ('k') | tools/usb_ids/usb_ids.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "device/usb/usb_ids.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace {
11
12 static const uint16_t kGoogleVendorId = 0x18d1;
13 static const uint16_t kNexusSProductId = 0x4e21;
14
15 } // namespace
16
17 namespace device {
18
19 TEST(UsbIdsTest, GetVendorName) {
20 EXPECT_EQ(NULL, UsbIds::GetVendorName(0));
21 EXPECT_EQ(std::string("Google Inc."), UsbIds::GetVendorName(kGoogleVendorId));
22 }
23
24 TEST(UsbIdsTest, GetProductName) {
25 EXPECT_EQ(NULL, UsbIds::GetProductName(0, 0));
26 EXPECT_EQ(NULL, UsbIds::GetProductName(kGoogleVendorId, 0));
27 EXPECT_EQ(std::string("Nexus S"), UsbIds::GetProductName(kGoogleVendorId,
28 kNexusSProductId));
29 }
30
31 } // namespace device
OLDNEW
« 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