#include "components/omnibox/browser/local_history_zero_suggest_provider.h"
#include <limits>
#include <memory>
#include <vector>
#include "base/i18n/case_conversion.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/keyword_search_term_util.h"
#include "components/history/core/browser/url_database.h"
#include "components/history/core/test/history_service_test_util.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_provider_listener.h"
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/fake_autocomplete_provider_client.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/search_engines_test_util.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/omnibox_focus_type.pb.h"
Time;
OmniboxEventProto;
kLocalHistoryZeroSuggestRelevanceScore;
namespace {
struct TestURLData { … };
struct TestMatchData { … };
}
class LocalHistoryZeroSuggestProviderTest
: public testing::TestWithParam<bool>,
public AutocompleteProviderListener { … };
void LocalHistoryZeroSuggestProviderTest::LoadURLs(
const std::vector<TestURLData>& url_data_list) { … }
void LocalHistoryZeroSuggestProviderTest::StartProviderAndWaitUntilDone(
const std::string& text = "",
metrics::OmniboxFocusType focus_type =
metrics::OmniboxFocusType::INTERACTION_FOCUS,
PageClassification page_classification = OmniboxEventProto::NTP_REALBOX,
const std::string& current_url = "") { … }
void LocalHistoryZeroSuggestProviderTest::OnProviderUpdate(
bool updated_matches,
const AutocompleteProvider* provider) { … }
void LocalHistoryZeroSuggestProviderTest::ExpectMatches(
const std::vector<TestMatchData>& match_data_list) { … }
void LocalHistoryZeroSuggestProviderTest::SignIn() { … }
void LocalHistoryZeroSuggestProviderTest::SignOut() { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, Input) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, Incognito) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, EntryPoint) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, Normalization) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, Ranking) { … }
TEST_F(LocalHistoryZeroSuggestProviderTest, Deletion) { … }