#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/omnibox/browser/shortcuts_provider_test_util.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/shortcuts_backend.h"
#include "components/omnibox/browser/shortcuts_provider.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "testing/gtest/include/gtest/gtest.h"
TestShortcutData::TestShortcutData(
std::string guid,
std::string text,
std::string fill_into_edit,
std::string destination_url,
AutocompleteMatch::DocumentType document_type,
std::string contents,
std::string contents_class,
std::string description,
std::string description_class,
ui::PageTransition transition,
AutocompleteMatch::Type type,
std::string keyword,
int days_from_now,
int number_of_hits) { … }
TestShortcutData::~TestShortcutData() { … }
void PopulateShortcutsBackendWithTestData(
scoped_refptr<ShortcutsBackend> backend,
TestShortcutData* db,
size_t db_size) { … }
void RunShortcutsProviderTest(
scoped_refptr<ShortcutsProvider> provider,
const std::u16string text,
bool prevent_inline_autocomplete,
const std::vector<ExpectedURLAndAllowedToBeDefault>& expected_urls,
std::string expected_top_result,
std::u16string top_result_inline_autocompletion) { … }
void RunShortcutsProviderTest(
scoped_refptr<ShortcutsProvider> provider,
const AutocompleteInput& input,
const std::vector<ExpectedURLAndAllowedToBeDefault>& expected_urls,
std::string expected_top_result,
std::u16string top_result_inline_autocompletion) { … }