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

Unified Diff: device/usb/mock_usb_service.h

Issue 1144493003: Extract //device/usb mocks so that they can be shared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android and GN builds for real. Created 5 years, 7 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/usb/mock_usb_device_handle.cc ('k') | device/usb/mock_usb_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/mock_usb_service.h
diff --git a/device/usb/mock_usb_service.h b/device/usb/mock_usb_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..31cecaf6611004cebd8762f31e971b565fb05b5a
--- /dev/null
+++ b/device/usb/mock_usb_service.h
@@ -0,0 +1,32 @@
+// 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.
+
+#ifndef DEVICE_USB_MOCK_USB_SERVICE_H_
+#define DEVICE_USB_MOCK_USB_SERVICE_H_
+
+#include "device/usb/usb_service.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace device {
+
+class MockUsbService : public UsbService {
+ public:
+ MockUsbService();
+ ~MockUsbService() override;
+
+ void AddDevice(scoped_refptr<UsbDevice> device);
+ void RemoveDevice(scoped_refptr<UsbDevice> device);
+
+ protected:
+ // UsbService implementation:
+ scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) override;
+ void GetDevices(const GetDevicesCallback& callback) override;
+
+ std::map<uint32, scoped_refptr<UsbDevice>> devices_;
+};
+
+} // namespace device
+
+#endif // DEVICE_USB_MOCK_USB_SERVICE_H_
« no previous file with comments | « device/usb/mock_usb_device_handle.cc ('k') | device/usb/mock_usb_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698