#include "components/policy/core/common/async_policy_provider.h"
#include <memory>
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "components/policy/core/common/async_policy_loader.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/core/common/schema_registry.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Mock;
Return;
Sequence;
namespace policy {
namespace {
void SetPolicy(PolicyBundle* bundle,
const std::string& name,
const std::string& value) { … }
class MockPolicyLoader : public AsyncPolicyLoader { … };
MockPolicyLoader::MockPolicyLoader(
scoped_refptr<base::SequencedTaskRunner> task_runner)
: … { … }
MockPolicyLoader::~MockPolicyLoader() { … }
PolicyBundle MockPolicyLoader::Load() { … }
}
class AsyncPolicyProviderTest : public testing::Test { … };
AsyncPolicyProviderTest::AsyncPolicyProviderTest() { … }
AsyncPolicyProviderTest::~AsyncPolicyProviderTest() { … }
void AsyncPolicyProviderTest::SetUp() { … }
void AsyncPolicyProviderTest::TearDown() { … }
TEST_F(AsyncPolicyProviderTest, RefreshPolicies) { … }
TEST_F(AsyncPolicyProviderTest, RefreshPoliciesTwice) { … }
TEST_F(AsyncPolicyProviderTest, RefreshPoliciesDuringReload) { … }
TEST_F(AsyncPolicyProviderTest, Shutdown) { … }
}