#include <stddef.h>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "base/memory/weak_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/accessibility_state_utils.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
#include "chrome/browser/ui/autofill/autofill_popup_view.h"
#include "chrome/browser/ui/autofill/autofill_suggestion_controller_test_base.h"
#include "chrome/browser/ui/autofill/popup_controller_common.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/autofill/content/browser/content_autofill_driver_factory_test_api.h"
#include "components/autofill/content/browser/test_autofill_client_injector.h"
#include "components/autofill/content/browser/test_autofill_driver_injector.h"
#include "components/autofill/content/browser/test_autofill_manager_injector.h"
#include "components/autofill/content/browser/test_content_autofill_client.h"
#include "components/autofill/core/browser/autofill_driver_router.h"
#include "components/autofill/core/browser/autofill_external_delegate.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/browser_autofill_manager_test_api.h"
#include "components/autofill/core/browser/ui/autofill_suggestion_delegate.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/browser/ui/suggestion_hiding_reason.h"
#include "components/autofill/core/browser/ui/suggestion_type.h"
#include "components/autofill/core/common/aliases.h"
#include "components/autofill/core/common/unique_ids.h"
#include "components/input/native_web_keyboard_event.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/video_picture_in_picture_window_controller.h"
#include "content/public/browser/weak_document_ptr.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/text_utils.h"
#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/autofill/test_autofill_keyboard_accessory_controller_autofill_client.h"
#else
#include "chrome/browser/ui/autofill/test_autofill_popup_controller_autofill_client.h"
#endif
namespace autofill {
namespace {
ASCIIToUTF16;
WeakPtr;
_;
AtLeast;
Field;
Invoke;
Mock;
Optional;
Return;
TestAutofillSuggestionControllerAutofillClient;
#endif
content::RenderFrameHost* CreateAndNavigateChildFrame(
content::RenderFrameHost* parent,
const GURL& url,
std::string_view name) { … }
content::RenderFrameHost* NavigateAndCommitFrame(content::RenderFrameHost* rfh,
const GURL& url) { … }
}
AutofillSuggestionControllerTest;
TEST_F(AutofillSuggestionControllerTest, ShowTwice) { … }
TEST_F(AutofillSuggestionControllerTest, ShowInformsDelegate) { … }
TEST_F(AutofillSuggestionControllerTest, UpdateDataListValues) { … }
TEST_F(AutofillSuggestionControllerTest, PopupsWithOnlyDataLists) { … }
TEST_F(AutofillSuggestionControllerTest, GetOrCreate) { … }
TEST_F(AutofillSuggestionControllerTest, ProperlyResetController) { … }
TEST_F(AutofillSuggestionControllerTest, HidingClearsPreview) { … }
TEST_F(AutofillSuggestionControllerTest, DontHideWhenWaitingForData) { … }
TEST_F(AutofillSuggestionControllerTest, ShouldReportHidingPopupReason) { … }
TEST_F(AutofillSuggestionControllerTest, SelectInvalidSuggestion) { … }
#if !BUILDFLAG(IS_ANDROID)
TEST_F(AutofillSuggestionControllerTest, CheckBoundsOverlapWithPictureInPicture) { … }
#endif
TEST_F(AutofillSuggestionControllerTest,
DoeNotHideOnFieldChangeForNonComposeEntries) { … }
class AutofillSuggestionControllerTestHidingLogic
: public AutofillSuggestionControllerTest { … };
TEST_F(AutofillSuggestionControllerTestHidingLogic,
KeepOpenInMainFrameOnSubFrameDestruction) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic,
KeepOpenInMainFrameOnSubFrameNavigation) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic, HideOnWebContentsDestroyed) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic, HideInMainFrameOnDestruction) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic, HideInSubFrameOnDestruction) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic,
HideInMainFrameOnMainFrameNavigation) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic,
HideInSubFrameOnSubFrameNavigation) { … }
TEST_F(AutofillSuggestionControllerTestHidingLogic,
HideInSubFrameOnMainFrameNavigation) { … }
}