#include "components/image_fetcher/core/cache/image_cache.h"
#include <map>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "components/image_fetcher/core/cache/image_data_store_disk.h"
#include "components/image_fetcher/core/cache/image_metadata_store_leveldb.h"
#include "components/image_fetcher/core/cache/proto/cached_image_metadata.pb.h"
#include "components/image_fetcher/core/image_fetcher_metrics_reporter.h"
#include "components/leveldb_proto/testing/fake_db.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
FakeDB;
Mock;
namespace image_fetcher {
namespace {
constexpr char kPrefLastStartupEviction[] = …;
constexpr char kImageFetcherEventHistogramName[] = …;
constexpr char kImageUrl[] = …;
constexpr char kOtherImageUrl[] = …;
constexpr char kImageUrlHashed[] = …;
constexpr char kImageData[] = …;
const int kOverMaxCacheSize = …;
}
class CachedImageFetcherImageCacheTest : public testing::Test { … };
TEST_F(CachedImageFetcherImageCacheTest, HashUrlToKeyTest) { … }
TEST_F(CachedImageFetcherImageCacheTest, SanityTest) { … }
TEST_F(CachedImageFetcherImageCacheTest, SaveCallsInitialization) { … }
TEST_F(CachedImageFetcherImageCacheTest, Save) { … }
TEST_F(CachedImageFetcherImageCacheTest, Load) { … }
TEST_F(CachedImageFetcherImageCacheTest, LoadReadOnly) { … }
TEST_F(CachedImageFetcherImageCacheTest, Delete) { … }
TEST_F(CachedImageFetcherImageCacheTest, Eviction) { … }
TEST_F(CachedImageFetcherImageCacheTest, EvictionHoldUtilExpires) { … }
TEST_F(CachedImageFetcherImageCacheTest, EvictionWhenFull) { … }
TEST_F(CachedImageFetcherImageCacheTest, EvictionTooSoon) { … }
TEST_F(CachedImageFetcherImageCacheTest, EvictionWhenEvictionAlreadyPerformed) { … }
TEST_F(CachedImageFetcherImageCacheTest, Reconciliation) { … }
TEST_F(CachedImageFetcherImageCacheTest, ReconciliationMismatchData) { … }
TEST_F(CachedImageFetcherImageCacheTest, ReconciliationMismatchMetadata) { … }
}