#include "components/omnibox/browser/document_provider.h"
#include <iterator>
#include <map>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
#include "base/i18n/time_formatting.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_provider.h"
#include "components/omnibox/browser/autocomplete_provider_listener.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
const char kSampleOriginalURL[] = …;
const char kSampleStrippedURL[] = …;
Return;
class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient { … };
}
class FakeDocumentProvider : public DocumentProvider { … };
class DocumentProviderTest : public testing::Test,
public AutocompleteProviderListener { … };
DocumentProviderTest::DocumentProviderTest() { … }
void DocumentProviderTest::SetUp() { … }
void DocumentProviderTest::OnProviderUpdate(
bool updated_matches,
const AutocompleteProvider* provider) { … }
void DocumentProviderTest::InitClient() { … }
TEST_F(DocumentProviderTest, IsDocumentProviderAllowed) { … }
TEST_F(DocumentProviderTest, IsInputLikelyURL) { … }
TEST_F(DocumentProviderTest, ParseDocumentSearchResults) { … }
#if BUILDFLAG(IS_IOS) && BUILDFLAG(USE_BLINK)
#define MAYBE_ProductDescriptionStringsAndAccessibleLabels …
#else
#define MAYBE_ProductDescriptionStringsAndAccessibleLabels …
#endif
TEST_F(DocumentProviderTest,
MAYBE_ProductDescriptionStringsAndAccessibleLabels) { … }
TEST_F(DocumentProviderTest, MatchDescriptionString) { … }
TEST_F(DocumentProviderTest, ParseDocumentSearchResultsBreakTies) { … }
TEST_F(DocumentProviderTest, ParseDocumentSearchResultsBreakTiesCascade) { … }
TEST_F(DocumentProviderTest, ParseDocumentSearchResultsBreakTiesZeroLimit) { … }
TEST_F(DocumentProviderTest, ParseDocumentSearchResultsWithBadResponse) { … }
#if !BUILDFLAG(IS_IOS)
TEST_F(DocumentProviderTest, GenerateLastModifiedString) { … }
#endif
TEST_F(DocumentProviderTest, GetURLForDeduping) { … }
TEST_F(DocumentProviderTest, CachingForAsyncMatches) { … }
TEST_F(DocumentProviderTest, CachingForSyncMatches) { … }
TEST_F(DocumentProviderTest, MaxMatches) { … }
TEST_F(DocumentProviderTest, StartCallsStop) { … }
TEST_F(DocumentProviderTest, Logging) { … }
TEST_F(DocumentProviderTest, LowQualitySuggestions) { … }