#include "components/omnibox/browser/base_search_provider.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/callback.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "build/chromeos_buildflags.h"
#include "components/omnibox/browser/actions/omnibox_action_in_suggest.h"
#include "components/omnibox/browser/actions/omnibox_answer_action.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_scheme_classifier.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_feature_configs.h"
#include "components/omnibox/browser/search_suggestion_parser.h"
#include "components/omnibox/browser/suggestion_answer.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_service_client.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/entity_info.pb.h"
#include "third_party/omnibox_proto/rich_answer_template.pb.h"
namespace {
SearchSuggestionParser::SuggestResult BuildSuggestion(
const std::u16string& query,
AutocompleteMatchType::Type type,
omnibox::SuggestType suggest_type,
std::vector<int> subtypes,
const std::string& additional_query_params,
int relevance,
bool should_prerender) { … }
}
_;
NiceMock;
Return;
class TestBaseSearchProvider : public BaseSearchProvider { … };
class BaseSearchProviderTestFixture { … };
class BaseSearchProviderTest : public BaseSearchProviderTestFixture,
public testing::Test { … };
TEST_F(BaseSearchProviderTest, PreserveAnswersWhenDeduplicating) { … }
TEST_F(BaseSearchProviderTest, AnswerData_PreserveAnswersWhenDeduplicating) { … }
TEST_F(BaseSearchProviderTest, PreserveImageWhenDeduplicating) { … }
TEST_F(BaseSearchProviderTest, PreserveSubtypesWhenDeduplicating) { … }
TEST_F(BaseSearchProviderTest, PreserveAdditionalQueryParamsWhenDeduplicating) { … }
TEST_F(BaseSearchProviderTest, MatchTailSuggestionProperly) { … }
TEST_F(BaseSearchProviderTest, DeleteDuplicateMatch) { … }
TEST_F(BaseSearchProviderTest, PrerenderDefaultMatch) { … }
class BaseSearchProviderOnDeviceSuggestionTest
: public BaseSearchProviderTestFixture,
public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(BaseSearchProviderOnDeviceSuggestionTest,
CreateOnDeviceSearchSuggestion) { … }
TEST_F(BaseSearchProviderTest, CreateActionInSuggest_BuildActionURL) { … }
TEST_F(BaseSearchProviderTest, CreateAnswerAction) { … }