#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/omnibox/browser/omnibox_edit_model.h"
#include <stddef.h>
#include <memory>
#include <string>
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/dom_distiller/core/url_utils.h"
#include "components/omnibox/browser/actions/omnibox_action.h"
#include "components/omnibox/browser/actions/tab_switch_action.h"
#include "components/omnibox/browser/autocomplete_controller.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/omnibox_controller.h"
#include "components/omnibox/browser/omnibox_popup_view.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/omnibox_view.h"
#include "components/omnibox/browser/search_provider.h"
#include "components/omnibox/browser/test_location_bar_model.h"
#include "components/omnibox/browser/test_omnibox_client.h"
#include "components/omnibox/browser/test_omnibox_edit_model.h"
#include "components/omnibox/browser/test_omnibox_view.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/prefs/testing_pref_service.h"
#include "components/url_formatter/url_fixer.h"
#include "omnibox_triggered_feature_service.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/omnibox_proto/answer_type.pb.h"
#include "ui/base/window_open_disposition.h"
#include "ui/gfx/geometry/rect.h"
OmniboxEventProto;
Selection;
_;
DoAll;
Return;
SaveArg;
namespace ui {
struct AXNodeData;
}
namespace {
class TestOmniboxPopupView : public OmniboxPopupView { … };
void OpenUrlFromEditBox(OmniboxController* controller,
TestOmniboxEditModel* model,
const std::u16string url_text,
bool is_autocompleted) { … }
}
class OmniboxEditModelTest : public testing::Test { … };
TEST_F(OmniboxEditModelTest, AdjustTextForCopy) { … }
TEST_F(OmniboxEditModelTest, AdjustTextForCopyReaderMode) { … }
TEST_F(OmniboxEditModelTest, DISABLED_InlineAutocompleteText) { … }
#if !BUILDFLAG(IS_IOS)
TEST_F(OmniboxEditModelTest, RespectUnelisionInZeroSuggest) { … }
#endif
TEST_F(OmniboxEditModelTest, RevertZeroSuggestTemporaryText) { … }
TEST_F(OmniboxEditModelTest, AlternateNavHasHTTP) { … }
TEST_F(OmniboxEditModelTest, CurrentMatch) { … }
TEST_F(OmniboxEditModelTest, DisplayText) { … }
TEST_F(OmniboxEditModelTest, UnelideDoesNothingWhenFullURLAlreadyShown) { … }
TEST_F(OmniboxEditModelTest, IgnoreInvalidSavedFocusStates) { … }
TEST_F(OmniboxEditModelTest, ConsumeCtrlKey) { … }
TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnRequestFocus) { … }
TEST_F(OmniboxEditModelTest, ConsumeCtrlKeyOnCtrlAction) { … }
TEST_F(OmniboxEditModelTest, KeywordModePreservesInlineAutocompleteText) { … }
TEST_F(OmniboxEditModelTest, KeywordModePreservesTemporaryText) { … }
TEST_F(OmniboxEditModelTest, CtrlEnterNavigatesToDesiredTLD) { … }
TEST_F(OmniboxEditModelTest, CtrlEnterNavigatesToDesiredTLDTemporaryText) { … }
TEST_F(OmniboxEditModelTest,
CtrlEnterNavigatesToDesiredTLDSteadyStateElisions) { … }
class OmniboxEditModelPopupTest : public ::testing::Test { … };
TEST_F(OmniboxEditModelPopupTest, SetSelectedLine) { … }
TEST_F(OmniboxEditModelPopupTest, SetSelectedLineWithNoDefaultMatches) { … }
TEST_F(OmniboxEditModelPopupTest, PopupPositionChanging) { … }
#if !(BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID))
TEST_F(OmniboxEditModelPopupTest, PopupStepSelection) { … }
#endif
TEST_F(OmniboxEditModelPopupTest, PopupStepSelectionWithHiddenGroupIds) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(OmniboxEditModelPopupTest, PopupStepSelectionWithActions) { … }
#endif
TEST_F(OmniboxEditModelPopupTest, PopupInlineAutocompleteAndTemporaryText) { … }
TEST_F(OmniboxEditModelPopupTest, TestFocusFixing) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(OmniboxEditModelPopupTest, OpenActionSelectionLogsOmniboxEvent) { … }
#endif
TEST_F(OmniboxEditModelPopupTest, OpenThumbsDownSelectionShowsFeedback) { … }
TEST_F(OmniboxEditModelTest, OmniboxEscapeHistogram) { … }
TEST_F(OmniboxEditModelTest, IPv4AddressPartsCount) { … }
#if !(BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID))
TEST_F(OmniboxEditModelTest, OpenTabMatch) { … }
#endif
TEST_F(OmniboxEditModelTest, LogAnswerUsed) { … }