chromium/components/history/core/browser/top_sites_impl_unittest.cc

// Copyright 2012 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/history/core/browser/top_sites_impl.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "components/history/core/browser/features.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/top_sites.h"
#include "components/history/core/browser/top_sites_observer.h"
#include "components/history/core/browser/visit_delegate.h"
#include "components/history/core/test/history_service_test_util.h"
#include "components/history/core/test/history_unittest_base.h"
#include "components/history/core/test/test_history_database.h"
#include "components/history/core/test/wait_top_sites_loaded_observer.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "components/search_engines/template_url.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

ContainerEq;

namespace history {

namespace {

const char kApplicationScheme[] =;
const char kPrepopulatedPageURL[] =;

// Returns whether `url` can be added to history.
bool MockCanAddURLToHistory(const GURL& url) {}

// Used for querying top sites. Either runs sequentially, or runs a nested
// nested run loop until the response is complete. The later is used when
// TopSites is queried before it finishes loading.
class TopSitesQuerier {};

}  // namespace

class TopSitesImplTest : public HistoryUnitTestBase {};  // Class TopSitesImplTest

class MockTopSitesObserver : public TopSitesObserver {};

// Tests DoTitlesDiffer.
TEST_F(TopSitesImplTest, DoTitlesDiffer) {}

// Tests DiffMostVisited.
TEST_F(TopSitesImplTest, DiffMostVisited) {}

// Tests GetMostVisitedURLs.
TEST_F(TopSitesImplTest, GetMostVisited) {}

// Tests GetMostVisitedURLs when AddMostRepeatedQueries is called.
TEST_F(TopSitesImplTest, GetMostVisitedURLsAndQueries) {}

// Tests GetMostVisitedURLs with a redirect.
TEST_F(TopSitesImplTest, GetMostVisitedWithRedirect) {}

// Makes sure changes done to top sites get mirrored to the db.
TEST_F(TopSitesImplTest, SaveToDB) {}

// More permutations of saving to db.
TEST_F(TopSitesImplTest, RealDatabase) {}

TEST_F(TopSitesImplTest, DeleteNotifications) {}

// Verifies that callbacks are notified correctly if requested before top sites
// has loaded.
TEST_F(TopSitesImplTest, NotifyCallbacksWhenLoaded) {}

// Makes sure canceled requests are not notified.
TEST_F(TopSitesImplTest, CancelingRequestsForTopSites) {}

// Tests variations of blocked urls.
TEST_F(TopSitesImplTest, BlockedUrlsWithoutPrepopulated) {}

// Tests variations of blocking including blocking prepopulated pages.
TEST_F(TopSitesImplTest, BlockingPrepopulated) {}

// Makes sure prepopulated pages exist.
TEST_F(TopSitesImplTest, AddPrepopulatedPages) {}

}  // namespace history