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

Unified Diff: chromeos/dbus/mock_auth_policy_client.h

Issue 2954293002: Chromad: Prevent session from starting without policy (Closed)
Patch Set: Fix initialization complete for component policy Created 3 years, 5 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
Index: chromeos/dbus/mock_auth_policy_client.h
diff --git a/chromeos/dbus/mock_auth_policy_client.h b/chromeos/dbus/mock_auth_policy_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..98c3984a978f94dfa45f5e80a051c59a70506a17
--- /dev/null
+++ b/chromeos/dbus/mock_auth_policy_client.h
@@ -0,0 +1,71 @@
+// Copyright 2017 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 CHROMEOS_DBUS_MOCK_AUTH_POLICY_CLIENT_H_
+#define CHROMEOS_DBUS_MOCK_AUTH_POLICY_CLIENT_H_
+
+#include "chromeos/dbus/auth_policy_client.h"
+
+#include <string>
+
+#include "base/logging.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+class AccountId;
+
+namespace chromeos {
+
+class MockAuthPolicyClient : public AuthPolicyClient {
+ public:
+ MockAuthPolicyClient();
+ virtual ~MockAuthPolicyClient();
+
+ MOCK_METHOD1(Init, void(dbus::Bus* bus));
+
+ void JoinAdDomain(const std::string& machine_name,
+ const std::string& user_principal_name,
+ int password_fd,
+ JoinCallback callback) {
+ // Not implemented.
+ NOTREACHED();
emaxx 2017/07/14 13:56:40 nit: Did you consider NOTIMPLEMENTED()?
Thiemo Nagel 2017/07/17 09:29:35 Done.
+ }
+
+ void AuthenticateUser(const std::string& user_principal_name,
+ const std::string& object_guid,
+ int password_fd,
+ AuthCallback callback) {
+ // Not implemented.
+ NOTREACHED();
+ }
+
+ void GetUserStatus(const std::string& object_guid,
+ GetUserStatusCallback callback) {
+ // Not implemented.
+ NOTREACHED();
+ }
+
+ void RefreshDevicePolicy(RefreshPolicyCallback callback) {
+ // Not implemented.
+ NOTREACHED();
+ }
+
+ void RefreshUserPolicy(const AccountId& account_id,
+ RefreshPolicyCallback callback) override {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback),
+ refresh_user_policy_callback_success_));
+ }
+
+ void SetRefreshUserPolicyCallbackSuccess(bool success) {
+ refresh_user_policy_callback_success_ = success;
+ }
+
+ private:
+ bool refresh_user_policy_callback_success_ = true;
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_MOCK_AUTH_POLICY_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698