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 #include "device/usb/mojo/mock_permission_provider.h" | 5 #include "device/usb/mojo/mock_permission_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "device/usb/public/interfaces/device.mojom.h" | 10 #include "device/usb/public/interfaces/device.mojom.h" |
11 | 11 |
12 using ::testing::Return; | 12 using ::testing::Return; |
13 using ::testing::_; | 13 using ::testing::_; |
14 | 14 |
15 namespace device { | 15 namespace device { |
16 namespace usb { | 16 namespace usb { |
17 | 17 |
18 MockPermissionProvider::MockPermissionProvider() : weak_factory_(this) { | 18 MockPermissionProvider::MockPermissionProvider() : weak_factory_(this) { |
19 ON_CALL(*this, HasDevicePermission(_)).WillByDefault(Return(true)); | 19 ON_CALL(*this, HasDevicePermission(_)).WillByDefault(Return(true)); |
20 ON_CALL(*this, HasConfigurationPermission(_, _)).WillByDefault(Return(true)); | |
21 ON_CALL(*this, HasFunctionPermission(_, _, _)).WillByDefault(Return(true)); | |
22 } | 20 } |
23 | 21 |
24 MockPermissionProvider::~MockPermissionProvider() {} | 22 MockPermissionProvider::~MockPermissionProvider() {} |
25 | 23 |
26 base::WeakPtr<PermissionProvider> MockPermissionProvider::GetWeakPtr() { | 24 base::WeakPtr<PermissionProvider> MockPermissionProvider::GetWeakPtr() { |
27 return weak_factory_.GetWeakPtr(); | 25 return weak_factory_.GetWeakPtr(); |
28 } | 26 } |
29 | 27 |
30 } // namespace usb | 28 } // namespace usb |
31 } // namespace device | 29 } // namespace device |
OLD | NEW |