#include <memory>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/installed_payment_apps_finder.h"
#include "content/public/browser/payment_app_provider.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/payments/payment_app.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
namespace content {
namespace {
CanMakePaymentEventData;
CanMakePaymentEventDataPtr;
CanMakePaymentResponsePtr;
PaymentCurrencyAmount;
PaymentDetailsModifier;
PaymentDetailsModifierPtr;
PaymentHandlerResponsePtr;
PaymentItem;
PaymentMethodData;
PaymentRequestEventData;
PaymentRequestEventDataPtr;
void OnPaymentAppInstall(base::OnceClosure done_callback,
bool* out_success,
bool success) { … }
void GetAllPaymentAppsCallback(
base::OnceClosure done_callback,
InstalledPaymentAppsFinder::PaymentApps* out_apps,
InstalledPaymentAppsFinder::PaymentApps apps) { … }
void CaptureCanMakePaymentResult(base::OnceClosure done_callback,
bool* out_payment_event_result,
CanMakePaymentResponsePtr response) { … }
void CaptureAbortResult(base::OnceClosure done_callback,
bool* out_payment_event_result,
bool payment_event_result) { … }
void InvokePaymentAppCallback(base::OnceClosure done_callback,
PaymentHandlerResponsePtr* out_response,
PaymentHandlerResponsePtr response) { … }
}
class PaymentAppBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest,
AbortPaymentWithInvalidRegistrationId) { … }
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest, AbortPayment) { … }
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest, CanMakePayment) { … }
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest, PaymentAppInvocationAndFailed) { … }
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest, PaymentAppInvocation) { … }
IN_PROC_BROWSER_TEST_F(PaymentAppBrowserTest, PaymentAppOpenWindowFailed) { … }
}