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

Side by Side Diff: device/usb/usb_context_unittest.cc

Issue 497363004: Merge components/usb_service into device/usb. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 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
« no previous file with comments | « device/usb/usb_context.cc ('k') | device/usb/usb_device.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 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 "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "components/usb_service/usb_context.h" 7 #include "device/usb/usb_context.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/libusb/src/libusb/libusb.h" 9 #include "third_party/libusb/src/libusb/libusb.h"
10 10
11 using usb_service::UsbContext; 11 namespace device {
12 using usb_service::PlatformUsbContext;
13 12
14 namespace { 13 namespace {
15 14
16 class UsbContextTest : public testing::Test { 15 class UsbContextTest : public testing::Test {
17 protected: 16 protected:
18 class UsbContextForTest : public UsbContext { 17 class UsbContextForTest : public UsbContext {
19 public: 18 public:
20 explicit UsbContextForTest(PlatformUsbContext context) 19 explicit UsbContextForTest(PlatformUsbContext context)
21 : UsbContext(context) {} 20 : UsbContext(context) {}
22 21
(...skipping 21 matching lines...) Expand all
44 PlatformUsbContext platform_context; 43 PlatformUsbContext platform_context;
45 ASSERT_EQ(LIBUSB_SUCCESS, libusb_init(&platform_context)); 44 ASSERT_EQ(LIBUSB_SUCCESS, libusb_init(&platform_context));
46 scoped_refptr<UsbContextForTest> context( 45 scoped_refptr<UsbContextForTest> context(
47 new UsbContextForTest(platform_context)); 46 new UsbContextForTest(platform_context));
48 } 47 }
49 base::TimeDelta elapse = base::TimeTicks::Now() - start; 48 base::TimeDelta elapse = base::TimeTicks::Now() - start;
50 if (elapse > base::TimeDelta::FromSeconds(2)) { 49 if (elapse > base::TimeDelta::FromSeconds(2)) {
51 FAIL(); 50 FAIL();
52 } 51 }
53 } 52 }
53
54 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_context.cc ('k') | device/usb/usb_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698