Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: content/browser/payments/payment_manager_unittest.cc

Issue 2958333002: [Payments] Implement web payment app manifest (Closed)
Patch Set: rename and comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c02744830170ae630148abb5b46cbbedcc5ff8bc..faaf3d4d5dce27cb0a8c01668156e15cbe10c116 100644
--- a/content/browser/payments/payment_manager_unittest.cc
+++ b/content/browser/payments/payment_manager_unittest.cc
@@ -129,7 +129,11 @@ TEST_F(PaymentManagerTest, SetAndGetPaymentInstrument) {
write_details->enabled_methods.push_back("visa");
write_details->stringified_capabilities = "{}";
SetPaymentInstrument("test_key", std::move(write_details), &write_status);
- ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+ // Write the first instrument of a web payment app will return
+ // FETCH_PAYMENT_APP_INFO_FAILED since the web app's manifest is not
+ // available, but the write of the instrument is succeed, othewise will return
+ // the other errors.
+ ASSERT_EQ(PaymentHandlerStatus::FETCH_PAYMENT_APP_INFO_FAILED, write_status);
PaymentHandlerStatus read_status = PaymentHandlerStatus::NOT_FOUND;
PaymentInstrumentPtr read_details;
@@ -155,7 +159,11 @@ TEST_F(PaymentManagerTest, DeletePaymentInstrument) {
write_details->enabled_methods.push_back("visa");
write_details->stringified_capabilities = "{}";
SetPaymentInstrument("test_key", std::move(write_details), &write_status);
- ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+ // Write the first instrument of a web payment app will return
+ // FETCH_PAYMENT_APP_INFO_FAILED since the web app's manifest is not
+ // available, but the write of the instrument is succeed, othewise will return
+ // the other errors.
+ ASSERT_EQ(PaymentHandlerStatus::FETCH_PAYMENT_APP_INFO_FAILED, write_status);
PaymentHandlerStatus read_status = PaymentHandlerStatus::NOT_FOUND;
PaymentInstrumentPtr read_details;
@@ -178,7 +186,11 @@ TEST_F(PaymentManagerTest, HasPaymentInstrument) {
write_details->enabled_methods.push_back("visa");
write_details->stringified_capabilities = "{}";
SetPaymentInstrument("test_key", std::move(write_details), &write_status);
- ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+ // Write the first instrument of a web payment app will return
+ // FETCH_PAYMENT_APP_INFO_FAILED since the web app's manifest is not
+ // available, but the write of the instrument is succeed, othewise will return
+ // the other errors.
+ ASSERT_EQ(PaymentHandlerStatus::FETCH_PAYMENT_APP_INFO_FAILED, write_status);
PaymentHandlerStatus has_status = PaymentHandlerStatus::NOT_FOUND;
HasPaymentInstrument("test_key", &has_status);
@@ -198,7 +210,12 @@ TEST_F(PaymentManagerTest, KeysOfPaymentInstruments) {
{
PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
SetPaymentInstrument("test_key1", PaymentInstrument::New(), &write_status);
- ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+ // Write the first instrument of a web payment app will return
+ // FETCH_PAYMENT_APP_INFO_FAILED since the web app's manifest is not
+ // available, but the write of the instrument is succeed, othewise will
+ // return the other errors.
+ ASSERT_EQ(PaymentHandlerStatus::FETCH_PAYMENT_APP_INFO_FAILED,
+ write_status);
}
{
PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
@@ -230,7 +247,12 @@ TEST_F(PaymentManagerTest, ClearPaymentInstruments) {
{
PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
SetPaymentInstrument("test_key1", PaymentInstrument::New(), &write_status);
- ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+ // Write the first instrument of a web payment app will return
+ // FETCH_PAYMENT_APP_INFO_FAILED since the web app's manifest is not
+ // available, but the write of the instrument is succeed, othewise will
+ // return the other errors.
+ ASSERT_EQ(PaymentHandlerStatus::FETCH_PAYMENT_APP_INFO_FAILED,
+ write_status);
}
{
PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
« no previous file with comments | « content/browser/payments/payment_manager.cc ('k') | content/browser/service_worker/service_worker_context_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698