Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ | 5 #ifndef DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
| 6 #define DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ | 6 #define DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "device/usb/mojo/permission_provider.h" | 11 #include "device/usb/mojo/permission_provider.h" |
| 12 #include "device/usb/usb_device.h" | |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 13 | 14 |
| 14 namespace device { | 15 namespace device { |
| 15 namespace usb { | 16 namespace usb { |
| 16 | 17 |
| 17 class MockPermissionProvider : public PermissionProvider { | 18 class MockPermissionProvider : public PermissionProvider { |
| 18 public: | 19 public: |
| 19 MockPermissionProvider(); | 20 MockPermissionProvider(); |
| 20 ~MockPermissionProvider() override; | 21 ~MockPermissionProvider() override; |
| 21 | 22 |
| 22 base::WeakPtr<PermissionProvider> GetWeakPtr(); | 23 base::WeakPtr<PermissionProvider> GetWeakPtr(); |
| 23 MOCK_CONST_METHOD1(HasDevicePermission, bool(const DeviceInfo& device_info)); | 24 MOCK_CONST_METHOD1(HasDevicePermission, |
| 25 bool(scoped_refptr<const UsbDevice> device_info)); | |
|
juncai
2016/04/01 17:05:24
change device_info parameter name to device.
Reilly Grant (use Gerrit)
2016/04/01 21:56:33
Done.
| |
| 24 MOCK_CONST_METHOD2(HasConfigurationPermission, | 26 MOCK_CONST_METHOD2(HasConfigurationPermission, |
| 25 bool(uint8_t requested_configuration, | 27 bool(uint8_t requested_configuration, |
| 26 const DeviceInfo& device_info)); | 28 scoped_refptr<const UsbDevice> device_info)); |
|
juncai
2016/04/01 17:05:24
ditto
Reilly Grant (use Gerrit)
2016/04/01 21:56:33
Done.
| |
| 27 MOCK_CONST_METHOD3(HasFunctionPermission, | 29 MOCK_CONST_METHOD3(HasFunctionPermission, |
| 28 bool(uint8_t requested_function, | 30 bool(uint8_t requested_function, |
| 29 uint8_t configuration_value, | 31 uint8_t configuration_value, |
| 30 const DeviceInfo& device_info)); | 32 scoped_refptr<const UsbDevice> device_info)); |
|
juncai
2016/04/01 17:05:24
ditto
Reilly Grant (use Gerrit)
2016/04/01 21:56:33
Done.
| |
| 31 | 33 |
| 32 private: | 34 private: |
| 33 base::WeakPtrFactory<PermissionProvider> weak_factory_; | 35 base::WeakPtrFactory<PermissionProvider> weak_factory_; |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 } // namespace usb | 38 } // namespace usb |
| 37 } // namespace device | 39 } // namespace device |
| 38 | 40 |
| 39 #endif // DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ | 41 #endif // DEVICE_USB_FAKE_PERMISSION_PROVIDER_H_ |
| OLD | NEW |