#include "components/omnibox/browser/autocomplete_controller_metrics.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/memory/raw_ref.h"
#include "base/ranges/algorithm.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/task_environment.h"
#include "base/time/time.h"
#include "components/omnibox/browser/autocomplete_controller.h"
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/fake_autocomplete_controller.h"
#include "components/omnibox/browser/fake_autocomplete_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
ElementsAre;
ElementsAreArray;
namespace {
class FakeAutocompleteProviderDelayed : public FakeAutocompleteProvider { … };
}
class AutocompleteControllerMetricsTest : public testing::Test { … };
TEST_F(AutocompleteControllerMetricsTest, SuggestionFinalization_SyncInput) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_OnlySyncUpdate) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_OnlySyncUpdateWithNoChanges) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_SyncAnd3AsyncUpdate) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_SyncAnd3AsyncUpdateWithNoChanges) { … }
TEST_F(
AutocompleteControllerMetricsTest,
SuggestionFinalization_UnchangedSyncAnd2UnchangedAnd1ChangedAsyncUpdates) { … }
TEST_F(
AutocompleteControllerMetricsTest,
SuggestionFinalization_UnchangedSyncAnd1ChangedAnd2UnchangedAsyncUpdates) { … }
TEST_F(
AutocompleteControllerMetricsTest,
SuggestionFinalization_UnchangedSyncAnd1ChangedAnd2UnchangedAsyncUpdates_ChangeAppliedBeforeDone) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_ChangedSyncAnd3UnchangedAsyncUpdates) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_StopTimerReached) { … }
TEST_F(AutocompleteControllerMetricsTest, SuggestionFinalization_Interrupted) { … }
TEST_F(AutocompleteControllerMetricsTest, SuggestionFinalization_ExpireTimer) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_MatchDeletion) { … }
TEST_F(AutocompleteControllerMetricsTest,
SuggestionFinalization_DefaultUnchanged) { … }
TEST_F(AutocompleteControllerMetricsTest, Provider_SyncAndAsyncCompletion) { … }
TEST_F(AutocompleteControllerMetricsTest,
Provider_1ProviderWithMultipleUpdates) { … }
TEST_F(AutocompleteControllerMetricsTest, Provider_Interrupted) { … }
TEST_F(AutocompleteControllerMetricsTest, MatchStability) { … }