#include "components/omnibox/browser/zero_suggest_cache_service.h"
#include <memory>
#include <string>
#include <vector>
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/fake_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/browser/zero_suggest_provider.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/omnibox_event.pb.h"
CacheEntry;
class FakeObserver : public ZeroSuggestCacheService::Observer { … };
struct TestCacheEntry { … };
class ZeroSuggestCacheServiceTest : public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ZeroSuggestCacheServiceTest, CacheStartsEmpty) { … }
TEST_P(ZeroSuggestCacheServiceTest, StoreResponseRecordsMemoryUsageHistogram) { … }
TEST_P(ZeroSuggestCacheServiceTest, StoreResponseUpdatesExistingEntry) { … }
TEST_P(ZeroSuggestCacheServiceTest, StoreResponseNotifiesObservers) { … }
TEST_P(ZeroSuggestCacheServiceTest, LeastRecentItemIsEvicted) { … }
TEST_P(ZeroSuggestCacheServiceTest, ReadResponseWillRetrieveMatchingData) { … }
TEST_P(ZeroSuggestCacheServiceTest, ReadResponseUpdatesRecency) { … }
TEST_P(ZeroSuggestCacheServiceTest, ClearCacheResultsInEmptyCache) { … }
TEST_P(ZeroSuggestCacheServiceTest, CacheLoadsFromPrefsOnStartup) { … }
TEST_P(ZeroSuggestCacheServiceTest, CacheDumpsToPrefsOnShutdown) { … }
TEST_P(ZeroSuggestCacheServiceTest, ClearCacheResultsInEmptyPersistencePrefs) { … }
TEST_P(ZeroSuggestCacheServiceTest,
GetSuggestResultsReturnsEmptyListForInvalidResponseJson) { … }