#include "components/payments/content/android_payment_app_factory.h"
#include <memory>
#include <utility>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "components/payments/content/android_app_communication.h"
#include "components/payments/content/android_app_communication_test_support.h"
#include "components/payments/content/mock_android_app_communication.h"
#include "components/payments/content/mock_payment_app_factory_delegate.h"
#include "components/payments/content/payment_app_factory.h"
#include "components/payments/content/payment_manifest_web_data_service.h"
#include "components/payments/content/payment_request_spec.h"
#include "components/payments/core/android_app_description.h"
#include "components/webauthn/core/browser/internal_authenticator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_web_contents_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
class BrowserContext;
}
namespace payments {
namespace {
RunOnceCallback;
class AndroidPaymentAppFactoryTest : public testing::Test { … };
TEST_F(AndroidPaymentAppFactoryTest, NullRenderFrameHost) { … }
class AndroidPaymentAppFactoryIntegrationTest : public testing::Test { … };
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
FactoryReturnsErrorWithoutPaymentAppInstance) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest, NoErrorsWhenNoApps) { … }
MATCHER_P3(PaymentAppMatches, type, package, method, "") { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
FindAppsThatDoNotHaveReadyToPayService) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
DoNotQueryReadyToPaySericeWhenOffTheRecord) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
FindTheTwaPaymentAppThatIsReadyToPayInTwaMode) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
IgnoreAppsThatAreNotReadyToPay) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest, FindTheCorrectTwaAppInTwaMode) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest, IgnoreNonTwaAppsInTwaMode) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
DoNotLookForAppsWhenOutsideOfTwaMode) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
DoNotLookForAppsForNonTwaMethod) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest, IgnoreNonTwaMethodInTheTwa) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
FindOnlyActivitiesWithTwaSpecificMethodName) { … }
TEST_F(AndroidPaymentAppFactoryIntegrationTest,
ReturnErrorWhenMoreThanOneServiceInApp) { … }
}
}