#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/autofill/autofill_uitest_util.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/sync/test/integration/secondary_account_helper.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/iban_bubble_controller_impl.h"
#include "chrome/browser/ui/autofill/payments/save_iban_ui.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h"
#include "chrome/browser/ui/views/autofill/payments/manage_saved_iban_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_iban_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_payment_icon_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/ui_test_utils.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/browser_autofill_manager.h"
#include "components/autofill/core/browser/form_data_importer.h"
#include "components/autofill/core/browser/form_data_importer_test_api.h"
#include "components/autofill/core/browser/metrics/payments/iban_metrics.h"
#include "components/autofill/core/browser/payments/iban_save_manager.h"
#include "components/autofill/core/browser/payments/payments_autofill_client.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/strike_databases/payments/iban_save_strike_database.h"
#include "components/autofill/core/browser/strike_databases/strike_database_integrator_base.h"
#include "components/autofill/core/browser/test_autofill_manager_waiter.h"
#include "components/autofill/core/browser/test_event_waiter.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_test_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_navigation_observer.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 "ui/events/base_event_utils.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace {
const char kIbanForm[] = …;
constexpr char kIbanValue[] = …;
constexpr char kIbanValueWithoutWhitespaces[] = …;
constexpr char kURLGetUploadDetailsRequest[] = …;
constexpr char kResponseGetUploadDetailsSuccess[] = …;
constexpr char kURLUploadIbanRequest[] = …;
constexpr char kResponsePaymentsSuccess[] = …;
constexpr char kResponsePaymentsFailure[] = …;
}
namespace autofill {
class IbanBubbleViewFullFormBrowserTest
: public SyncTest,
public IbanSaveManager::ObserverForTest,
public IbanBubbleControllerImpl::ObserverForTest { … };
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
Local_ClickingNoThanksClosesBubble) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
Local_ClickingXIconClosesBubble) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
StrikeDatabase_Local_FullFlowTest) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
Local_ClickingSaveClosesBubble) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
Local_ClickingSaveClosesBubble_WithNickname) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
Local_ClickingClosesBubbleStillShowOmnibox) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
DISABLED_Local_SavedIbanHasNickname) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewFullFormBrowserTest,
DISABLED_Local_SavedIbanNoNickname) { … }
class IbanBubbleViewSyncTransportFullFormBrowserTest
: public IbanBubbleViewFullFormBrowserTest { … };
IN_PROC_BROWSER_TEST_F(IbanBubbleViewSyncTransportFullFormBrowserTest,
Upload_ClickingSaveClosesBubble_Success) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewSyncTransportFullFormBrowserTest,
Upload_ClickingSaveClosesBubble_Fail) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewSyncTransportFullFormBrowserTest,
Upload_ClickingDeclineClosesBubble) { … }
IN_PROC_BROWSER_TEST_F(IbanBubbleViewSyncTransportFullFormBrowserTest,
Upload_FailedPreflightCallThenLocalSave) { … }
}