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

Side by Side Diff: trunk/src/device/hid/hid_service_unittest.cc

Issue 148183015: Revert 247926 "HID backend" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/device/hid/hid_service_mac.cc ('k') | trunk/src/device/hid/hid_service_win.h » ('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 2014 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 #include <vector>
7
8 #include "base/bind.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h"
11 #include "device/hid/hid_connection.h"
12 #include "device/hid/hid_service.h"
13 #include "net/base/io_buffer.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15
16 // TODO(rockot): Enable tests once ChromeOS HID testing hardware is in place.
17 #if defined(OS_CHROMEOS)
18 #define MAYBE_Create DISABLED_Create
19 #else
20 #define MAYBE_Create Create
21 #endif
22
23 namespace device {
24
25 namespace {
26
27 const int kUSBLUFADemoVID = 0x03eb;
28 const int kUSBLUFADemoPID = 0x204f;
29
30 } // namespace
31
32 TEST(HidServiceTest, MAYBE_Create) {
33 base::MessageLoopForIO message_loop;
34 HidService* service = HidService::GetInstance();
35 ASSERT_TRUE(service);
36
37 std::vector<HidDeviceInfo> devices;
38 service->GetDevices(&devices);
39 std::string target_device;
40
41 for (std::vector<HidDeviceInfo>::iterator it = devices.begin();
42 it != devices.end();
43 ++it) {
44 if (it->vendor_id == kUSBLUFADemoVID && it->product_id == kUSBLUFADemoPID) {
45 target_device = it->device_id;
46 break;
47 }
48 }
49
50 if (devices.size() > 0) {
51 EXPECT_NE(std::string(""), target_device);
52 }
53 }
54
55 } // namespace device
OLDNEW
« no previous file with comments | « trunk/src/device/hid/hid_service_mac.cc ('k') | trunk/src/device/hid/hid_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698