OLD | NEW |
1 // Copyright 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 <vector> | 5 #include <vector> |
6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
8 #include "device/hid/hid_service.h" | 9 #include "device/hid/hid_service.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 namespace device { | 12 namespace device { |
12 | 13 |
13 TEST(HidServiceTest, Create) { | 14 TEST(HidServiceTest, Create) { |
14 base::MessageLoopForIO message_loop; | 15 base::MessageLoopForIO message_loop; |
15 HidService* service = HidService::Create(message_loop.message_loop_proxy()); | 16 scoped_ptr<HidService> service( |
| 17 HidService::Create(message_loop.message_loop_proxy())); |
16 ASSERT_TRUE(service); | 18 ASSERT_TRUE(service); |
17 | 19 |
18 std::vector<HidDeviceInfo> devices; | 20 std::vector<HidDeviceInfo> devices; |
19 service->GetDevices(&devices); | 21 service->GetDevices(&devices); |
20 for (std::vector<HidDeviceInfo>::iterator it = devices.begin(); | 22 for (std::vector<HidDeviceInfo>::iterator it = devices.begin(); |
21 it != devices.end(); | 23 it != devices.end(); |
22 ++it) { | 24 ++it) { |
23 ASSERT_TRUE(it->device_id != kInvalidHidDeviceId); | 25 ASSERT_TRUE(it->device_id != kInvalidHidDeviceId); |
24 } | 26 } |
25 } | 27 } |
26 | 28 |
27 } // namespace device | 29 } // namespace device |
OLD | NEW |