#include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h"
#include "base/functional/bind_internal.h"
#include "base/functional/callback_forward.h"
#include "base/scoped_environment_variable_override.h"
#include "base/scoped_observation.h"
#include "base/strings/strcat.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/consent_auditor/consent_auditor_factory.h"
#include "chrome/browser/consent_auditor/consent_auditor_test_utils.h"
#include "chrome/browser/signin/signin_browser_test_base.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/test/test_browser_ui.h"
#include "chrome/browser/ui/views/profiles/profile_management_step_controller.h"
#include "chrome/browser/ui/views/profiles/profile_picker_view_test_utils.h"
#include "chrome/browser/ui/views/profiles/profiles_pixel_test_utils.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_test_utils.h"
#include "chrome/browser/ui/webui/signin/signin_url_utils.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/consent_auditor/consent_auditor.h"
#include "components/consent_auditor/fake_consent_auditor.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/base/signin_buildflags.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/signin/public/identity_manager/tribool.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_navigation_observer.h"
#include "ui/base/ui_base_switches.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/views/widget/any_widget_observer.h"
#if !BUILDFLAG(ENABLE_DICE_SUPPORT) && !BUILDFLAG(IS_CHROMEOS_LACROS)
#error Platform not supported
#endif
namespace {
AllOf;
Contains;
ElementsAre;
struct MinorModeRestrictions { … };
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
constexpr MinorModeRestrictions kWithMinorModeRestrictionsWithUnrestrictedUser{ … };
constexpr MinorModeRestrictions kWithMinorModeRestrictionsWithRestrictedUser{ … };
#endif
struct SyncConfirmationTestParam { … };
std::string ParamToTestSuffix(
const ::testing::TestParamInfo<SyncConfirmationTestParam>& info) { … }
const SyncConfirmationTestParam kWindowTestParams[] = …;
const SyncConfirmationTestParam kDialogTestParams[] = …;
GURL BuildSyncConfirmationWindowURL() { … }
class SyncConfirmationStepControllerForTest
: public ProfileManagementStepController { … };
}
class SyncConfirmationUIWindowPixelTest
: public ProfilesPixelTestBaseT<UiBrowserTest>,
public testing::WithParamInterface<SyncConfirmationTestParam> { … };
IN_PROC_BROWSER_TEST_P(SyncConfirmationUIWindowPixelTest, InvokeUi_default) { … }
INSTANTIATE_TEST_SUITE_P(…);
class SyncConfirmationUIDialogPixelTest
: public ProfilesPixelTestBaseT<DialogBrowserTest>,
public testing::WithParamInterface<SyncConfirmationTestParam> { … };
IN_PROC_BROWSER_TEST_P(SyncConfirmationUIDialogPixelTest, InvokeUi_default) { … }
INSTANTIATE_TEST_SUITE_P(…);
enum class SyncConfirmationUIAction { … };
class SyncConfirmationUITest
: public SigninBrowserTestBase,
public testing::WithParamInterface<
std::tuple<bool, SyncConfirmationUIAction, std::string>>,
public LoginUIService::Observer { … };
IN_PROC_BROWSER_TEST_P(SyncConfirmationUITest,
RecordConsentWithEscapedHtmlCharacters) { … }
std::string SyncConfirmationUITestParamToTestSuffix(
const testing::TestParamInfo<SyncConfirmationUITest::ParamType>& info) { … }
INSTANTIATE_TEST_SUITE_P(…);