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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp

Issue 2355463002: [PaymentReqeust] Add error message in PaymentDetails. (in blink side) (Closed)
Patch Set: rebase from origin Created 4 years, 3 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: third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
index 0455d16b71d46c39345a9ab21ce9d9266eb0dd2a..d7a216813b5f97ae7eae0d9db9b10a6591f10eca 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
@@ -114,15 +114,25 @@ PaymentDetails buildPaymentDetailsForTest(PaymentTestDetailToChange detail, Paym
else
modifier = buildPaymentDetailsModifierForTest();
+ String errorMessage = "";
+ if (detail == PaymentTestDetailError)
+ errorMessage = valueToUse;
+
PaymentDetails result;
result.setTotal(total);
result.setDisplayItems(HeapVector<PaymentItem>(1, item));
result.setShippingOptions(HeapVector<PaymentShippingOption>(1, shippingOption));
result.setModifiers(HeapVector<PaymentDetailsModifier>(1, modifier));
+ result.setError(errorMessage);
return result;
}
+PaymentDetails buildPaymentDetailsErrorMsgForTest(const String& valueToUse)
+{
+ return buildPaymentDetailsForTest(PaymentTestDetailError, PaymentTestDataNone, PaymentTestOverwriteValue, valueToUse);
+}
+
HeapVector<PaymentMethodData> buildPaymentMethodDataForTest()
{
HeapVector<PaymentMethodData> methodData(1, PaymentMethodData());

Powered by Google App Engine
This is Rietveld 408576698