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

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

Issue 161823002: Clean up HID backend and API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 | « device/hid/hid_service_mac.cc ('k') | 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
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string>
6 #include <vector> 5 #include <vector>
7 6
8 #include "base/bind.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
11 #include "device/hid/hid_connection.h"
12 #include "device/hid/hid_service.h" 8 #include "device/hid/hid_service.h"
13 #include "net/base/io_buffer.h"
14 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
15 10
16 namespace device { 11 namespace device {
17 12
18 TEST(HidServiceTest, Create) { 13 TEST(HidServiceTest, Create) {
19 base::MessageLoopForIO message_loop; 14 base::MessageLoopForIO message_loop;
20 HidService* service = HidService::GetInstance(); 15 HidService* service = HidService::GetInstance();
21 ASSERT_TRUE(service); 16 ASSERT_TRUE(service);
22 17
23 std::vector<HidDeviceInfo> devices; 18 std::vector<HidDeviceInfo> devices;
24 service->GetDevices(&devices); 19 service->GetDevices(&devices);
25
26 for (std::vector<HidDeviceInfo>::iterator it = devices.begin(); 20 for (std::vector<HidDeviceInfo>::iterator it = devices.begin();
27 it != devices.end(); 21 it != devices.end();
28 ++it) { 22 ++it) {
29 ASSERT_TRUE(!it->device_id.empty()); 23 ASSERT_TRUE(it->device_id != kInvalidHidDeviceId);
30 } 24 }
31 } 25 }
32 26
33 } // namespace device 27 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_service_mac.cc ('k') | device/hid/hid_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698