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

Unified Diff: device/usb/mojo/mock_permission_provider.cc

Issue 1847183002: Use interface associations to check function permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit and fixed Windows build. Created 4 years, 9 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/mojo/mock_permission_provider.h ('k') | device/usb/mojo/permission_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/mojo/mock_permission_provider.cc
diff --git a/device/usb/mojo/mock_permission_provider.cc b/device/usb/mojo/mock_permission_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e45b0f6db532266d0807fb097a6c902e56b47f22
--- /dev/null
+++ b/device/usb/mojo/mock_permission_provider.cc
@@ -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 "device/usb/mojo/mock_permission_provider.h"
+
+#include <stddef.h>
+#include <utility>
+
+#include "device/usb/public/interfaces/device.mojom.h"
+
+using ::testing::Return;
+using ::testing::_;
+
+namespace device {
+namespace usb {
+
+MockPermissionProvider::MockPermissionProvider() : weak_factory_(this) {
+ ON_CALL(*this, HasDevicePermission(_)).WillByDefault(Return(true));
+ ON_CALL(*this, HasConfigurationPermission(_, _)).WillByDefault(Return(true));
+ ON_CALL(*this, HasFunctionPermission(_, _, _)).WillByDefault(Return(true));
+}
+
+MockPermissionProvider::~MockPermissionProvider() {}
+
+base::WeakPtr<PermissionProvider> MockPermissionProvider::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
+} // namespace usb
+} // namespace device
« no previous file with comments | « device/usb/mojo/mock_permission_provider.h ('k') | device/usb/mojo/permission_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698