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

Side by Side Diff: device/usb/mojo/mock_permission_provider.h

Issue 1847183002: Use interface associations to check function permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser_test build and addressed juncai@'s comments. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_USB_MOCK_PERMISSION_PROVIDER_H_
juncai 2016/04/02 00:16:04 nit: add "_MOJO" substring to the include guard: D
Reilly Grant (use Gerrit) 2016/04/02 01:35:45 Done.
6 #define DEVICE_USB_MOCK_PERMISSION_PROVIDER_H_
7
8 #include <stdint.h>
9
10 #include "base/memory/weak_ptr.h"
11 #include "device/usb/mojo/permission_provider.h"
12 #include "testing/gmock/include/gmock/gmock.h"
13
14 namespace device {
15 namespace usb {
16
17 class MockPermissionProvider : public PermissionProvider {
18 public:
19 MockPermissionProvider();
20 ~MockPermissionProvider() override;
21
22 base::WeakPtr<PermissionProvider> GetWeakPtr();
23 MOCK_CONST_METHOD1(HasDevicePermission, bool(const DeviceInfo& device_info));
24 MOCK_CONST_METHOD2(HasConfigurationPermission,
25 bool(uint8_t requested_configuration,
26 const DeviceInfo& device_info));
27 MOCK_CONST_METHOD3(HasFunctionPermission,
28 bool(uint8_t requested_function,
29 uint8_t configuration_value,
30 const DeviceInfo& device_info));
31
32 private:
33 base::WeakPtrFactory<PermissionProvider> weak_factory_;
34 };
35
36 } // namespace usb
37 } // namespace device
38
39 #endif // DEVICE_USB_MOCK_PERMISSION_PROVIDER_H_
OLDNEW
« no previous file with comments | « device/usb/mojo/fake_permission_provider.cc ('k') | device/usb/mojo/mock_permission_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698