chromium/components/omnibox/browser/local_history_zero_suggest_provider_unittest.cc

// Copyright 2019 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/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 {

// Used to populate the URLDatabase.
struct TestURLData {};

// Used to validate expected autocomplete matches.
struct TestMatchData {};

}  // namespace

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

// Tests that suggestions are returned only if when input is empty and focused.
TEST_F(LocalHistoryZeroSuggestProviderTest, Input) {}

// Tests that suggestions are returned only if user is not in an off-the-record
// context.
TEST_F(LocalHistoryZeroSuggestProviderTest, Incognito) {}

// Tests that suggestions are allowed in the eligibile entry points.
TEST_F(LocalHistoryZeroSuggestProviderTest, EntryPoint) {}

// Tests that search terms are extracted from the default search provider's
// search history only and only when Google is the default search provider.
TEST_F(LocalHistoryZeroSuggestProviderTest, DefaultSearchProvider) {}

// Tests that extracted search terms are normalized (their whitespaces are
// collapsed, are lowercased and deduplicated) without loss of unicode encoding.
TEST_F(LocalHistoryZeroSuggestProviderTest, Normalization) {}

// Tests that the suggestions are ranked correctly.
TEST_F(LocalHistoryZeroSuggestProviderTest, Ranking) {}

// Tests that the provider supports deletion of matches.
TEST_F(LocalHistoryZeroSuggestProviderTest, Deletion) {}