#include "chrome/browser/payments/secure_payment_confirmation_browsertest.h"
#include <stdint.h>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "components/autofill/core/browser/test_event_waiter.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/payments/content/payment_manifest_web_data_service.h"
#include "components/payments/core/error_strings.h"
#include "components/payments/core/secure_payment_confirmation_credential.h"
#include "components/webdata_services/web_data_service_wrapper_factory.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/payments/payment_handler_host.mojom.h"
namespace payments {
void SecurePaymentConfirmationTest::SetUpCommandLine(
base::CommandLine* command_line) { … }
void SecurePaymentConfirmationTest::OnAppListReady() { … }
void SecurePaymentConfirmationTest::OnErrorDisplayed() { … }
void SecurePaymentConfirmationTest::OnWebDataServiceRequestDone(
WebDataServiceBase::Handle h,
std::unique_ptr<WDTypedResult> result) { … }
void SecurePaymentConfirmationTest::ExpectEvent2Histogram(
std::set<JourneyLogger::Event2> events,
int count) { … }
std::string SecurePaymentConfirmationTest::GetWebAuthnErrorMessage() { … }
namespace {
Event2;
std::string GetIconDownloadErrorMessage() { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest, Show_TransactionUX) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest, Show_NoAuthenticator) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest,
Show_NoMatchingCredential) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest,
Show_WrongCredentialRpId) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest, IconDownloadFailure) { … }
class SecurePaymentConfirmationDisableDebugTest
: public SecurePaymentConfirmationTest { … };
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationDisableDebugTest,
CanMakePayment_NoAuthenticator) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest,
CanMakePayment_HasAuthenticator) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationTest,
CanMakePayment_CanMakePaymentEnabledPref) { … }
#if !BUILDFLAG(IS_ANDROID)
class SecurePaymentConfirmationDisabledTest
: public PaymentRequestPlatformBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationDisabledTest,
PaymentMethodNotSupported) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationDisabledTest,
CannotMakePayment) { … }
class SecurePaymentConfirmationDisabledByFinchTest
: public PaymentRequestPlatformBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationDisabledByFinchTest,
PaymentMethodNotSupported) { … }
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationDisabledByFinchTest,
CannotMakePayment) { … }
#endif
class SecurePaymentConfirmationActivationlessShowTest
: public SecurePaymentConfirmationTest { … };
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationActivationlessShowTest,
ActivationlessShow) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ShowAfterActivationlessShow …
#else
#define MAYBE_ShowAfterActivationlessShow …
#endif
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationActivationlessShowTest,
MAYBE_ShowAfterActivationlessShow) { … }
}
}