chromium/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/policy/core/common/cloud/component_cloud_policy_service.h"

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>

#include "base/containers/contains.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/values_test_util.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "components/policy/core/common/cloud/resource_cache.h"
#include "components/policy/core/common/cloud/test/policy_builder.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
#include "components/policy/core/common/values_util.h"
#include "components/policy/proto/chrome_extension_policy.pb.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "crypto/rsa_private_key.h"
#include "crypto/sha2.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

em;

_;
AtLeast;
Mock;
Return;

namespace policy {

namespace {

const char kTestExtension[] =;
const char kTestExtension2[] =;
const char kTestDownload[] =;

const char kTestPolicy[] =;

const char kInvalidTestPolicy[] =;

const char kTestSchema[] =;

class MockComponentCloudPolicyDelegate
    : public ComponentCloudPolicyService::Delegate {};

struct ComponentCloudPolicyServiceObserverImpl
    : ComponentCloudPolicyServiceObserver {};

}  // namespace

class ComponentCloudPolicyServiceTest : public testing::Test {};

TEST_F(ComponentCloudPolicyServiceTest, InitializeStoreThenRegistry) {}

TEST_F(ComponentCloudPolicyServiceTest, InitializeRegistryThenStore) {}

TEST_F(ComponentCloudPolicyServiceTest, InitializeWithCachedPolicy) {}

TEST_F(ComponentCloudPolicyServiceTest, FetchPolicy) {}

TEST_F(ComponentCloudPolicyServiceTest, ComponentPolicyMapIsSetAndObserved) {}

TEST_F(ComponentCloudPolicyServiceTest, FetchPolicyBeforeStoreLoaded) {}

TEST_F(ComponentCloudPolicyServiceTest,
       FetchPolicyWithCachedPolicyBeforeStoreLoaded) {}

TEST_F(ComponentCloudPolicyServiceTest, LoadCacheAndDeleteExtensions) {}

TEST_F(ComponentCloudPolicyServiceTest, SignInAfterStartup) {}

TEST_F(ComponentCloudPolicyServiceTest, SignOut) {}

TEST_F(ComponentCloudPolicyServiceTest, LoadInvalidPolicyFromCache) {}

TEST_F(ComponentCloudPolicyServiceTest, PurgeWhenServerRemovesPolicy) {}

TEST_F(ComponentCloudPolicyServiceTest, KeyRotation) {}

}  // namespace policy