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

Unified Diff: device/test/test_device_client.h

Issue 1314273002: Manage UsbService lifetime in DeviceClient implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/test/test_device_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/test/test_device_client.h
diff --git a/device/test/test_device_client.h b/device/test/test_device_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..ce70f3896880f68fa3237c99a75ea36a94b142e9
--- /dev/null
+++ b/device/test/test_device_client.h
@@ -0,0 +1,31 @@
+// Copyright 2015 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 "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "device/core/device_client.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace device {
+
+class HidService;
+class UsbService;
+
+class TestDeviceClient : public DeviceClient {
+ public:
+ TestDeviceClient(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ ~TestDeviceClient() override;
+
+ private:
+ HidService* GetHidService() override;
+ UsbService* GetUsbService() override;
+
+ scoped_ptr<UsbService> usb_service_;
+ scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner_;
+};
+
+} // namespace device
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/test/test_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698