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 <stddef.h> |
| 6 |
5 #include <vector> | 7 #include <vector> |
6 | 8 |
7 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
8 #include "device/hid/input_service_linux.h" | 10 #include "device/hid/input_service_linux.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
10 | 12 |
11 namespace device { | 13 namespace device { |
12 | 14 |
13 TEST(InputServiceLinux, Simple) { | 15 TEST(InputServiceLinux, Simple) { |
14 base::MessageLoopForIO message_loop; | 16 base::MessageLoopForIO message_loop; |
15 InputServiceLinux* service = InputServiceLinux::GetInstance(); | 17 InputServiceLinux* service = InputServiceLinux::GetInstance(); |
16 | 18 |
17 ASSERT_TRUE(service); | 19 ASSERT_TRUE(service); |
18 std::vector<InputServiceLinux::InputDeviceInfo> devices; | 20 std::vector<InputServiceLinux::InputDeviceInfo> devices; |
19 service->GetDevices(&devices); | 21 service->GetDevices(&devices); |
20 for (size_t i = 0; i < devices.size(); ++i) | 22 for (size_t i = 0; i < devices.size(); ++i) |
21 ASSERT_TRUE(!devices[i].id.empty()); | 23 ASSERT_TRUE(!devices[i].id.empty()); |
22 } | 24 } |
23 | 25 |
24 } // namespace device | 26 } // namespace device |
OLD | NEW |