chromium/components/omnibox/browser/bookmark_provider_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/omnibox/browser/bookmark_provider.h"

#include <stddef.h>

#include <memory>
#include <string>
#include <vector>

#include "base/memory/ref_counted.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/titled_url_match.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/browser/titled_url_match_utils.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.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/metrics_proto/omnibox_event.pb.h"
#include "third_party/metrics_proto/omnibox_focus_type.pb.h"

BookmarkModel;
BookmarkNode;
TitledUrlMatch;

namespace {

// The bookmark corpus against which we will simulate searches.
struct BookmarksTestInfo {} bookmark_provider_test_data[] =;

// Structures and functions supporting the BookmarkProviderTest.Positions
// unit test.

struct TestBookmarkPosition {};
TestBookmarkPositions;

// Return |positions| as a formatted string for unit test diagnostic output.
std::string TestBookmarkPositionsAsString(
    const TestBookmarkPositions& positions) {}

// Return the positions in |matches| as a formatted string for unit test
// diagnostic output.
std::u16string MatchesAsString16(const ACMatches& matches) {}

// Convenience function to make comparing ACMatchClassifications against the
// test expectations structure easier.
TestBookmarkPositions PositionsFromAutocompleteMatch(
    const AutocompleteMatch& match) {}

}  // namespace

class BookmarkProviderTest : public testing::Test {};

BookmarkProviderTest::BookmarkProviderTest() {}

void BookmarkProviderTest::SetUp() {}

void BookmarkProviderTest::ResetProvider() {}

size_t BookmarkProviderTest::GetNumMatches(std::string input_text) {}

TEST_F(BookmarkProviderTest, Positions) {}

TEST_F(BookmarkProviderTest, Rankings) {}

TEST_F(BookmarkProviderTest, InlineAutocompletion) {}

TEST_F(BookmarkProviderTest, StripHttpAndAdjustOffsets) {}

TEST_F(BookmarkProviderTest, DoesNotProvideMatchesOnFocus) {}

TEST_F(BookmarkProviderTest, ShortBookmarks) {}

TEST_F(BookmarkProviderTest, GetMatchesWithBookmarkPaths) {}

// Make sure that user input is trimmed correctly for starter pack keyword mode.
// In this mode, suggestions should be provided for only the user input after
// the keyword, i.e. "@bookmarks domain" should only match "domain".
TEST_F(BookmarkProviderTest, KeywordModeExtractUserInput) {}

TEST_F(BookmarkProviderTest, MaxMatches) {}