#include "chrome/browser/ui/views/profiles/profile_picker_view.h"
#include "base/check.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/metrics/user_action_tester.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_dialog_service.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/ui/profiles/profile_picker.h"
#include "chrome/browser/ui/views/profiles/profile_picker_interactive_uitest_base.h"
#include "chrome/browser/ui/views/profiles/profile_picker_test_base.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/interaction/interactive_browser_test.h"
#include "components/search_engines/search_engines_switches.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
Eq;
IsFalse;
IsTrue;
namespace {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(…);
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(…);
DEFINE_LOCAL_CUSTOM_ELEMENT_EVENT_TYPE(…);
DEFINE_LOCAL_CUSTOM_ELEMENT_EVENT_TYPE(…);
const WebContentsInteractionTestUtil::DeepQuery kSignInButton = …;
const WebContentsInteractionTestUtil::DeepQuery kContinueWithoutAccountButton = …;
const WebContentsInteractionTestUtil::DeepQuery kAddProfileButton = …;
class WidgetBoundsChangeWaiter : public views::WidgetObserver { … };
struct TestParam { … };
std::string ParamToTestSuffix(const ::testing::TestParamInfo<TestParam>& info) { … }
const TestParam kTestParams[] = …;
}
struct NavState { … };
class ProfilePickerInteractiveUiTest
: public InteractiveBrowserTest,
public WithProfilePickerInteractiveUiTestHelpers { … };
class ProfilePickerParametrizedInteractiveUiTest
: public ProfilePickerInteractiveUiTest,
public testing::WithParamInterface<TestParam> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest, CloseWithKeyboard) { … }
#if BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest, ExitWithKeyboard) {
ShowAndFocusPicker(ProfilePicker::EntryPoint::kProfileMenuManageProfiles,
GURL("chrome://profile-picker"));
EXPECT_TRUE(ProfilePicker::IsOpen());
SendQuitAppKeyboardCommand();
WaitForPickerClosed();
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
}
#endif
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest, FullscreenWithKeyboard) { … }
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest,
CloseDiceSigninWithKeyboard) { … }
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest,
NavigateBackFromDiceSigninWithKeyboard) { … }
#endif
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest,
NavigateBackFromProfileTypeChoiceWithKeyboard) { … }
IN_PROC_BROWSER_TEST_F(ProfilePickerInteractiveUiTest,
NavigateBackFromNewProfileWithKeyboard) { … }
IN_PROC_BROWSER_TEST_P(ProfilePickerParametrizedInteractiveUiTest,
ContinueWithoutAccount) { … }