#include "chrome/browser/extensions/api/storage/managed_value_store_cache.h"
#include "base/json/json_reader.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/repeating_test_future.h"
#include "base/test/test_future.h"
#include "chrome/test/base/testing_profile.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_service_impl.h"
#include "components/policy/core/common/policy_types.h"
#include "components/value_store/test_value_store_factory.h"
#include "components/value_store/value_store.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/api/storage/backend_task_runner.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace {
ValueStore;
constexpr auto kAnyPolicyScope = …;
constexpr auto kAnyPolicySource = …;
constexpr auto kAnotherPolicyDomain = …;
base::Value::Dict CreateDict(const std::string& json) { … }
class PolicyBuilder { … };
class FakeSettingsObserver { … };
class ManagedValueStoreCacheTest : public testing::Test { … };
TEST_F(ManagedValueStoreCacheTest,
ShouldInformObserverWhenPolicyValuesAreUpdated) { … }
TEST_F(ManagedValueStoreCacheTest,
ShouldStoreMandatoryPolicyValuesForAnExtension) { … }
TEST_F(ManagedValueStoreCacheTest,
ShouldIgnoreRecommendedPolicyValuesForAnExtension) { … }
TEST_F(ManagedValueStoreCacheTest, ShouldIgnorePoliciesInAnotherDomain) { … }
TEST_F(ManagedValueStoreCacheTest,
ValueStoreShouldNotContainValuesOfOtherExtensions) { … }
TEST_F(ManagedValueStoreCacheTest, FetchingUnknownValueShouldNotReturnAnError) { … }
TEST_F(ManagedValueStoreCacheTest, FetchingUnsetValueShouldNotReturnAnError) { … }
TEST_F(ManagedValueStoreCacheTest, ShouldBeAbleToFetchAnEmptyValueStore) { … }
TEST_F(ManagedValueStoreCacheTest,
RunWithValueStoreForExtensionShouldWaitUntilPolicyServiceIsInitialized) { … }
TEST_F(ManagedValueStoreCacheTest,
ShouldStorePolicyValuesSetBeforePolicyServiceIsInitialized) { … }
TEST_F(ManagedValueStoreCacheTest,
RunWithValueStoreForExtensionCallbackShouldOnlyBeInvokedOnce) { … }
}
}