#include "components/policy/core/common/cloud/resource_cache.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace policy {
namespace {
const char kKey1[] = …;
const char kKey2[] = …;
const char kKey3[] = …;
const char kSubA[] = …;
const char kSubB[] = …;
const char kSubC[] = …;
const char kSubD[] = …;
const char kSubE[] = …;
const char kData0[] = …;
const char kData1[] = …;
const int kMaxCacheSize = …;
const std::string kData1Kb = …;
const std::string kData2Kb = …;
const std::string kData9Kb = …;
const std::string kData10Kb = …;
const std::string kData9KbUpdated = …;
bool Matches(const std::string& expected, const std::string& subkey) { … }
}
class ResourceCacheTest : public testing::Test { … };
TEST_F(ResourceCacheTest, StoreAndLoad) { … }
TEST_F(ResourceCacheTest, FilterSubkeys) { … }
TEST_F(ResourceCacheTest, StoreWithEnabledCacheLimit) { … }
#if BUILDFLAG(IS_POSIX)
TEST_F(ResourceCacheTest, StoreInDirectoryWithCycleSymlinks) { … }
TEST_F(ResourceCacheTest, StoreInDirectoryWithSymlinkToRoot) { … }
#endif
}