| 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();
|
| + }
|
| +
|
| + 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_
|
|
|