summaryrefslogtreecommitdiffstats
path: root/chrome/browser/usb/usb_service_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/usb/usb_service_unittest.cc')
-rw-r--r--chrome/browser/usb/usb_service_unittest.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/browser/usb/usb_service_unittest.cc b/chrome/browser/usb/usb_service_unittest.cc
new file mode 100644
index 0000000..b0eeb9b
--- /dev/null
+++ b/chrome/browser/usb/usb_service_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/usb/usb_service.h"
+
+#include "build/build_config.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+typedef testing::Test UsbServiceTest;
+
+#if defined(OS_LINUX)
+// Linux trybot does not support usb.
+#define MAYBE_GracefulShutdown DISABLED_GracefulShutdown
+#elif defined(OS_ANDROID)
+// Android build does not include usb support.
+#define MAYBE_GracefulShutdown DISABLED_GracefulShutdown
+#else
+#define MAYBE_GracefulShutdown GracefulShutdown
+#endif
+
+TEST_F(UsbServiceTest, MAYBE_GracefulShutdown) {
+ base::TimeTicks start = base::TimeTicks::Now();
+ scoped_ptr<UsbService> service(new UsbService());
+ service->Shutdown();
+ base::TimeDelta elapse = base::TimeTicks::Now() - start;
+ if (elapse > base::TimeDelta::FromSeconds(2)) {
+ FAIL();
+ }
+}
+
+} // namespace