Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / device / hid / hid_service_unittest.cc
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 <vector>
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h"
9 #include "device/hid/hid_service.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace device {
13
14 TEST(HidServiceTest, Create) {
15   base::MessageLoopForIO message_loop;
16   HidService* service = HidService::GetInstance(
17       message_loop.message_loop_proxy(),
18       message_loop.message_loop_proxy());
19   ASSERT_TRUE(service);
20
21   std::vector<HidDeviceInfo> devices;
22   service->GetDevices(&devices);
23   for (std::vector<HidDeviceInfo>::iterator it = devices.begin();
24       it != devices.end();
25       ++it) {
26     ASSERT_TRUE(it->device_id != kInvalidHidDeviceId);
27   }
28 }
29
30 }  // namespace device