#include <ctime>
#include <list>
#include <memory>
#include <string>
#include <utility>
#include "base/callback_list.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/autofill/autofill_uitest_util.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/ui/autofill/payments/local_card_migration_bubble_controller_impl.h"
#include "chrome/browser/ui/autofill/payments/local_card_migration_dialog_controller_impl.h"
#include "chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/migratable_card_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_container.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/browser/webdata_services/web_data_service_factory.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/autofill/content/browser/content_autofill_client.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/content/browser/test_autofill_manager_injector.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/browser_autofill_manager.h"
#include "components/autofill/core/browser/form_data_importer.h"
#include "components/autofill/core/browser/metrics/payments/local_card_migration_metrics.h"
#include "components/autofill/core/browser/payments/credit_card_save_manager.h"
#include "components/autofill/core/browser/payments/local_card_migration_manager.h"
#include "components/autofill/core/browser/payments/payments_util.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
#include "components/autofill/core/browser/personal_data_manager_test_utils.h"
#include "components/autofill/core/browser/test_autofill_manager_waiter.h"
#include "components/autofill/core/browser/test_event_waiter.h"
#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/network_session_configurator/common/network_switches.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/test/fake_server.h"
#include "components/sync/test/fake_server_network_resources.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/base_event_utils.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/animating_layout_manager.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"
#include "ui/views/test/widget_test.h"
Bucket;
ElementsAre;
namespace autofill {
namespace {
ACTION_P(QuitMessageLoop, loop) { … }
constexpr char kURLGetUploadDetailsRequest[] = …;
constexpr char kURLMigrateCardRequest[] = …;
constexpr char kResponseGetUploadDetailsSuccess[] = …;
constexpr char kResponseGetUploadDetailsSuccessLong[] = …;
constexpr char kResponseGetUploadDetailsFailure[] = …;
constexpr char kResponseMigrateCardSuccess[] = …;
constexpr char kCreditCardFormURL[] = …;
constexpr char kFirstCardNumber[] = …;
constexpr char kSecondCardNumber[] = …;
constexpr char kThirdCardNumber[] = …;
constexpr char kInvalidCardNumber[] = …;
constexpr char kMaskedCardNumber[] = …;
constexpr double kFakeGeolocationLatitude = …;
constexpr double kFakeGeolocationLongitude = …;
}
class LocalCardMigrationBrowserTest
: public SyncTest,
public LocalCardMigrationManager::ObserverForTest { … };
class LocalCardMigrationBrowserUiTest
: public SupportsTestDialog<LocalCardMigrationBrowserTest> { … };
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_UsingNewCardDoesNotShowIntermediateMigrationOffer) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_IntermediateMigrationOfferDoesNotShowWhenPaymentsDeclines) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ReusingServerCardDoesNotShowIntermediateMigrationOffer) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ReusingServerCardWithMigratableLocalCardShowIntermediateMigrationOffer) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ReusingLocalCardDoesNotShowIntermediateMigrationOffer) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ReusingLocalCardShowsIntermediateMigrationOffer) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClickingCloseClosesBubble) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_CreditCardIconShownInLocationBar) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClickingOmniboxIconReshowsBubble) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClickingContinueOpensDialog) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_DialogContainsAllValidMigratableCard) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClickingCancelClosesDialog) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClickingSaveClosesDialog) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_DeleteSuccessfullyMigratedCardsFromLocal) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_AcceptingDialogAddsLocalCardMigrationStrikes) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_RejectingDialogAddsLocalCardMigrationStrikes) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosingBubbleAddsLocalCardMigrationStrikes) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosingBubbleAgainAddsLocalCardMigrationStrikes) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ReshowingBubbleDoesNotAddStrikes) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosedReason_BubbleAccepted) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosedReason_BubbleClosed) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosedReason_BubbleNotInteracted) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_ClosedReason_BubbleLostFocus) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_CardIdentifierString) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserTest,
DISABLED_IconViewAccessibleName) { … }
IN_PROC_BROWSER_TEST_F(
LocalCardMigrationBrowserUiTest,
DISABLED_InvokeUi_default) { … }
}