#include "components/omnibox/browser/autocomplete_controller.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/json/json_reader.h"
#include "base/memory/scoped_refptr.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/omnibox/browser/actions/omnibox_answer_action.h"
#include "components/omnibox/browser/autocomplete_controller.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_provider.h"
#include "components/omnibox/browser/fake_autocomplete_controller.h"
#include "components/omnibox/browser/fake_autocomplete_provider.h"
#include "components/omnibox/browser/fake_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_feature_configs.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_starter_pack_data.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/omnibox_proto/answer_type.pb.h"
#include "third_party/omnibox_proto/rich_answer_template.pb.h"
namespace {
bool ParseAnswer(const std::string& answer_json,
omnibox::AnswerType answer_type,
SuggestionAnswer* answer) { … }
}
class AutocompleteControllerTest : public testing::Test { … };
TEST_F(AutocompleteControllerTest, RemoveCompanyEntityImage) { … }
TEST_F(AutocompleteControllerTest, CompanyEntityImageNotRemoved) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(AutocompleteControllerTest, FilterMatchesForInstantKeywordWithBareAt) { … }
#endif
TEST_F(AutocompleteControllerTest, UpdateResult_SyncAnd2Async) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_TransferringOldMatches) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_PreservingDefault) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_Ranking) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_ZPSEnabledAndShownInSession) { … }
#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !BUILDFLAG(IS_ANDROID) && \
!BUILDFLAG(IS_IOS)
TEST_F(AutocompleteControllerTest, MlRanking) { … }
TEST_F(AutocompleteControllerTest, MlRanking_ApplyPiecewiseScoringTransform) { … }
TEST_F(AutocompleteControllerTest, MlRanking_PiecewiseMappedSearchBlending) { … }
TEST_F(AutocompleteControllerTest, MlRanking_MappedSearchBlending) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_MLRanking_PreserveDefault) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_MLRanking_AllMatches) { … }
#endif
TEST_F(AutocompleteControllerTest, UpdateResult_NotifyingAndTimers) { … }
TEST_F(AutocompleteControllerTest, ExplicitStop) { … }
TEST_F(AutocompleteControllerTest, UpdateResult_ForceAllowedToBeDefault) { … }
TEST_F(AutocompleteControllerTest, ExtraHeaders) { … }
TEST_F(AutocompleteControllerTest, ShouldRunProvider) { … }
TEST_F(AutocompleteControllerTest,
ShouldRunProvider_LimitKeywordModeSuggestions) { … }
TEST_F(AutocompleteControllerTest, ShouldRunProvider_LensSearchbox) { … }
TEST_F(AutocompleteControllerTest, UpdateSearchboxStatsForAnswerAction) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(AutocompleteControllerTest, NoPedalsAttachedToLensSearchboxMatches) { … }
#endif