| Index: content/browser/payments/payment_manager_unittest.cc
|
| diff --git a/content/browser/payments/payment_manager_unittest.cc b/content/browser/payments/payment_manager_unittest.cc
|
| index 07e522c1d4358f8e532c9ad32bceba0d049bf2b0..42d80cbfff986ece75b125273a2dbf05557be1ed 100644
|
| --- a/content/browser/payments/payment_manager_unittest.cc
|
| +++ b/content/browser/payments/payment_manager_unittest.cc
|
| @@ -14,8 +14,6 @@
|
| namespace content {
|
| namespace {
|
|
|
| -using ::payments::mojom::PaymentAppManifestError;
|
| -using ::payments::mojom::PaymentAppManifestPtr;
|
| using ::payments::mojom::PaymentHandlerStatus;
|
| using ::payments::mojom::PaymentInstrument;
|
| using ::payments::mojom::PaymentInstrumentPtr;
|
| @@ -23,23 +21,6 @@ using ::payments::mojom::PaymentInstrumentPtr;
|
| const char kServiceWorkerPattern[] = "https://example.com/a";
|
| const char kServiceWorkerScript[] = "https://example.com/a/script.js";
|
|
|
| -void SetManifestCallback(bool* called,
|
| - PaymentAppManifestError* out_error,
|
| - PaymentAppManifestError error) {
|
| - *called = true;
|
| - *out_error = error;
|
| -}
|
| -
|
| -void GetManifestCallback(bool* called,
|
| - PaymentAppManifestPtr* out_manifest,
|
| - PaymentAppManifestError* out_error,
|
| - PaymentAppManifestPtr manifest,
|
| - PaymentAppManifestError error) {
|
| - *called = true;
|
| - *out_manifest = std::move(manifest);
|
| - *out_error = error;
|
| -}
|
| -
|
| void DeletePaymentInstrumentCallback(PaymentHandlerStatus* out_status,
|
| PaymentHandlerStatus status) {
|
| *out_status = status;
|
| @@ -141,72 +122,6 @@ class PaymentManagerTest : public PaymentAppContentUnitTestBase {
|
| DISALLOW_COPY_AND_ASSIGN(PaymentManagerTest);
|
| };
|
|
|
| -TEST_F(PaymentManagerTest, SetAndGetManifest) {
|
| - bool called = false;
|
| - PaymentAppManifestError error =
|
| - PaymentAppManifestError::MANIFEST_STORAGE_OPERATION_FAILED;
|
| - SetManifest(payment_manager(),
|
| - CreatePaymentAppManifestForTest(kServiceWorkerPattern),
|
| - base::Bind(&SetManifestCallback, &called, &error));
|
| - ASSERT_TRUE(called);
|
| -
|
| - ASSERT_EQ(PaymentAppManifestError::NONE, error);
|
| -
|
| - called = false;
|
| - PaymentAppManifestPtr read_manifest;
|
| - PaymentAppManifestError read_error =
|
| - PaymentAppManifestError::MANIFEST_STORAGE_OPERATION_FAILED;
|
| - GetManifest(payment_manager(), base::Bind(&GetManifestCallback, &called,
|
| - &read_manifest, &read_error));
|
| - ASSERT_TRUE(called);
|
| -
|
| - ASSERT_EQ(payments::mojom::PaymentAppManifestError::NONE, read_error);
|
| - EXPECT_EQ("payment-app-icon", read_manifest->icon.value());
|
| - EXPECT_EQ(kServiceWorkerPattern, read_manifest->name);
|
| - ASSERT_EQ(1U, read_manifest->options.size());
|
| - EXPECT_EQ("payment-app-icon", read_manifest->options[0]->icon.value());
|
| - EXPECT_EQ("Visa ****", read_manifest->options[0]->name);
|
| - EXPECT_EQ("payment-app-id", read_manifest->options[0]->id);
|
| - ASSERT_EQ(1U, read_manifest->options[0]->enabled_methods.size());
|
| - EXPECT_EQ("visa", read_manifest->options[0]->enabled_methods[0]);
|
| -}
|
| -
|
| -TEST_F(PaymentManagerTest, SetManifestWithoutAssociatedServiceWorker) {
|
| - bool called = false;
|
| - PaymentAppManifestError error = PaymentAppManifestError::NONE;
|
| - UnregisterServiceWorker(GURL(kServiceWorkerPattern));
|
| - SetManifest(payment_manager(),
|
| - CreatePaymentAppManifestForTest(kServiceWorkerPattern),
|
| - base::Bind(&SetManifestCallback, &called, &error));
|
| - ASSERT_TRUE(called);
|
| -
|
| - EXPECT_EQ(PaymentAppManifestError::NO_ACTIVE_WORKER, error);
|
| -}
|
| -
|
| -TEST_F(PaymentManagerTest, GetManifestWithoutAssociatedServiceWorker) {
|
| - bool called = false;
|
| - PaymentAppManifestPtr read_manifest;
|
| - PaymentAppManifestError read_error = PaymentAppManifestError::NONE;
|
| - UnregisterServiceWorker(GURL(kServiceWorkerPattern));
|
| - GetManifest(payment_manager(), base::Bind(&GetManifestCallback, &called,
|
| - &read_manifest, &read_error));
|
| - ASSERT_TRUE(called);
|
| -
|
| - EXPECT_EQ(PaymentAppManifestError::NO_ACTIVE_WORKER, read_error);
|
| -}
|
| -
|
| -TEST_F(PaymentManagerTest, GetManifestWithNoSavedManifest) {
|
| - bool called = false;
|
| - PaymentAppManifestPtr read_manifest;
|
| - PaymentAppManifestError read_error = PaymentAppManifestError::NONE;
|
| - GetManifest(payment_manager(), base::Bind(&GetManifestCallback, &called,
|
| - &read_manifest, &read_error));
|
| - ASSERT_TRUE(called);
|
| -
|
| - EXPECT_EQ(PaymentAppManifestError::MANIFEST_STORAGE_OPERATION_FAILED,
|
| - read_error);
|
| -}
|
| -
|
| TEST_F(PaymentManagerTest, SetAndGetPaymentInstrument) {
|
| PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
|
| PaymentInstrumentPtr write_details = PaymentInstrument::New();
|
|
|