#ifdef UNSAFE_BUFFERS_BUILD
#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 {
struct BookmarksTestInfo { … } bookmark_provider_test_data[] = …;
struct TestBookmarkPosition { … };
TestBookmarkPositions;
std::string TestBookmarkPositionsAsString(
const TestBookmarkPositions& positions) { … }
std::u16string MatchesAsString16(const ACMatches& matches) { … }
TestBookmarkPositions PositionsFromAutocompleteMatch(
const AutocompleteMatch& match) { … }
}
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) { … }
TEST_F(BookmarkProviderTest, KeywordModeExtractUserInput) { … }
TEST_F(BookmarkProviderTest, MaxMatches) { … }