#include "components/omnibox/browser/scored_history_match.h"
#include <memory>
#include <numeric>
#include <string>
#include <utility>
#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/i18n/break_iterator.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/search_terms_data.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
ASCIIToUTF16;
ElementsAre;
Pair;
namespace {
VisitInfoVector CreateVisitInfoVector(int num_visits,
int frequency,
base::Time now) { … }
}
class ScoredHistoryMatchPublic : public ScoredHistoryMatch { … };
class ScoredHistoryMatchTest : public testing::Test { … };
history::URLRow ScoredHistoryMatchTest::MakeURLRow(const char* url,
const char* title,
int visit_count,
int days_since_last_visit,
int typed_count) { … }
void ScoredHistoryMatchTest::PopulateWordStarts(const history::URLRow& url_row,
RowWordStarts* word_starts) { … }
String16Vector ScoredHistoryMatchTest::Make1Term(const char* term) const { … }
String16Vector ScoredHistoryMatchTest::Make2Terms(const char* term_1,
const char* term_2) const { … }
float ScoredHistoryMatchTest::GetTopicalityScoreOfTermAgainstURLAndTitle(
const std::vector<std::string>& terms,
const WordStarts term_word_starts,
const GURL& url,
const std::u16string& title) { … }
TEST_F(ScoredHistoryMatchTest, Scoring) { … }
TEST_F(ScoredHistoryMatchTest, ScoringBookmarks) { … }
TEST_F(ScoredHistoryMatchTest, ScoringTLD) { … }
TEST_F(ScoredHistoryMatchTest, ScoringScheme) { … }
TEST_F(ScoredHistoryMatchTest, MatchURLComponents) { … }
TEST_F(ScoredHistoryMatchTest, GetTopicalityScoreTrailingSlash) { … }
TEST_F(ScoredHistoryMatchTest, FilterMatches) { … }
TEST_F(ScoredHistoryMatchTest, GetFrequency) { … }
TEST_F(ScoredHistoryMatchTest, GetDocumentSpecificityScore) { … }
TEST_F(ScoredHistoryMatchTest, GetTopicalityScore) { … }
TEST_F(ScoredHistoryMatchTest, GetTopicalityScore_MidwordMatching) { … }
TEST_F(ScoredHistoryMatchTest, GetFinalRelevancyScore) { … }
TEST_F(ScoredHistoryMatchTest, GetHQPBucketsFromString) { … }
TEST_F(ScoredHistoryMatchTest, GetDomainRelevancyScore) { … }