chromium/components/omnibox/browser/autocomplete_controller_unittest.cc

// Copyright 2023 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/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) {}

}  // namespace

class AutocompleteControllerTest : public testing::Test {};

TEST_F(AutocompleteControllerTest, RemoveCompanyEntityImage) {}

TEST_F(AutocompleteControllerTest, CompanyEntityImageNotRemoved) {}

// Desktop has some special handling for bare '@' inputs.
#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) {}

// Android and iOS aren't ready for ML and won't pass this test because they
// have their own grouping code.
#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  //  BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !BUILDFLAG(IS_ANDROID) &&
        //  !BUILDFLAG(IS_IOS)

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) {}

// Anroid and iOS have different handling for pedals.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(AutocompleteControllerTest, NoPedalsAttachedToLensSearchboxMatches) {}
#endif