#include "chrome/browser/ui/autofill/payments/mandatory_reauth_bubble_controller_impl.h"
#include "base/functional/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/ui/autofill/autofill_bubble_base.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/metrics/payments/mandatory_reauth_metrics.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
class TestMandatoryReauthBubbleControllerImpl
: public MandatoryReauthBubbleControllerImpl { … };
class MandatoryReauthBubbleControllerImplTest
: public BrowserWithTestWindowTest { … };
TEST_F(MandatoryReauthBubbleControllerImplTest,
SuccessfullyInvokesAcceptCallback) { … }
TEST_F(MandatoryReauthBubbleControllerImplTest,
SuccessfullyInvokesCancelCallback) { … }
TEST_F(MandatoryReauthBubbleControllerImplTest,
SuccessfullyInvokesCloseCallback) { … }
TEST_F(MandatoryReauthBubbleControllerImplTest,
Metrics_OptInConfirmationBubble_Shown) { … }
class MandatoryReauthBubbleControllerOptInBubbleMetricsTest
: public MandatoryReauthBubbleControllerImplTest,
public testing::WithParamInterface<bool> { … };
std::string GetOfferMetricsPath(bool is_reshow) { … }
std::string GetResultMetricsPath(bool is_reshow) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
Metrics_OptInBubble_Shown) { … }
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
Metrics_MandatoryReauthOptInBubbleMetric_Accepted) { … }
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
Metrics_OptInBubble_Cancelled) { … }
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
Metrics_OptInBubble_Closed) { … }
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
Metrics_OptInBubble_LostFocus) { … }
TEST_P(MandatoryReauthBubbleControllerOptInBubbleMetricsTest,
MetricsOptInBubble_NotInteracted) { … }
}