chromium/components/image_fetcher/core/cache/image_cache_unittest.cc

// Copyright 2018 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/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 =;

}  // namespace

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) {}

// Verifies eviction for CacheStrategy::HOLD_UNTIL_EXPIRED.
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) {}

}  // namespace image_fetcher