blob: 3352860b2891815476e714d5fd003d127ffc2a0e [file] [log] [blame]
// Copyright (c) 2012 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 COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_
#define COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_
#include "components/policy/core/common/policy_service.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace policy {
class MockPolicyServiceObserver : public PolicyService::Observer {
public:
MockPolicyServiceObserver();
~MockPolicyServiceObserver() override;
MOCK_METHOD3(OnPolicyUpdated, void(const PolicyNamespace&,
const PolicyMap& previous,
const PolicyMap& current));
MOCK_METHOD1(OnPolicyServiceInitialized, void(PolicyDomain));
};
class MockPolicyService : public PolicyService {
public:
MockPolicyService();
~MockPolicyService() override;
MOCK_METHOD2(AddObserver, void(PolicyDomain, Observer*));
MOCK_METHOD2(RemoveObserver, void(PolicyDomain, Observer*));
MOCK_CONST_METHOD1(GetPolicies, const PolicyMap&(const PolicyNamespace&));
MOCK_CONST_METHOD1(IsInitializationComplete, bool(PolicyDomain domain));
MOCK_METHOD1(RefreshPolicies, void(const base::Closure&));
};
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_COMMON_MOCK_POLICY_SERVICE_H_