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

Side by Side Diff: components/usb_service/usb_context_unittest.cc

Issue 236203019: Move UsbService to its own component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move usb_service component symbols into usb_service namespace Created 6 years, 8 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 | « components/usb_service/usb_context.cc ('k') | components/usb_service/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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/usb/usb_context.h"
6
7 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
8 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "components/usb_service/usb_context.h"
9 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/libusb/src/libusb/libusb.h" 9 #include "third_party/libusb/src/libusb/libusb.h"
11 10
11 using usb_service::UsbContext;
12 using usb_service::PlatformUsbContext;
13
12 namespace { 14 namespace {
13 15
14 class UsbContextTest : public testing::Test { 16 class UsbContextTest : public testing::Test {
15 protected: 17 protected:
16 class UsbContextForTest : public UsbContext { 18 class UsbContextForTest : public UsbContext {
17 public: 19 public:
18 explicit UsbContextForTest(PlatformUsbContext context) 20 explicit UsbContextForTest(PlatformUsbContext context)
19 : UsbContext(context) {} 21 : UsbContext(context) {}
22
20 private: 23 private:
21 virtual ~UsbContextForTest() {} 24 virtual ~UsbContextForTest() {}
22 DISALLOW_COPY_AND_ASSIGN(UsbContextForTest); 25 DISALLOW_COPY_AND_ASSIGN(UsbContextForTest);
23 }; 26 };
24 }; 27 };
25 28
26 } // namespace 29 } // namespace
27 30
28 #if defined(OS_LINUX) 31 #if defined(OS_LINUX)
29 // Linux trybot does not support usb. 32 // Linux trybot does not support usb.
(...skipping 11 matching lines...) Expand all
41 PlatformUsbContext platform_context; 44 PlatformUsbContext platform_context;
42 ASSERT_EQ(LIBUSB_SUCCESS, libusb_init(&platform_context)); 45 ASSERT_EQ(LIBUSB_SUCCESS, libusb_init(&platform_context));
43 scoped_refptr<UsbContextForTest> context( 46 scoped_refptr<UsbContextForTest> context(
44 new UsbContextForTest(platform_context)); 47 new UsbContextForTest(platform_context));
45 } 48 }
46 base::TimeDelta elapse = base::TimeTicks::Now() - start; 49 base::TimeDelta elapse = base::TimeTicks::Now() - start;
47 if (elapse > base::TimeDelta::FromSeconds(2)) { 50 if (elapse > base::TimeDelta::FromSeconds(2)) {
48 FAIL(); 51 FAIL();
49 } 52 }
50 } 53 }
OLDNEW
« no previous file with comments | « components/usb_service/usb_context.cc ('k') | components/usb_service/usb_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698