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

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

Issue 1877943002: Add unit test for providing empty list of detail items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/PaymentDetailsTestHelper.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp b/third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp
index b5ace517da6a72fb4c99a2e9fabaa6aa85e15a55..fe617a5d8eb36e855f91f1c9ade83cdc0970f22e 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp
@@ -93,7 +93,10 @@ PaymentDetails buildPaymentDetailsForTest(PaymentTestDetailToChange detail, Paym
shippingOption = buildShippingOptionForTest();
PaymentDetails result;
- result.setItems(HeapVector<PaymentItem>(1, item));
+ if (detail == PaymentTestDetailNoItems)
+ result.setItems(HeapVector<PaymentItem>());
+ else
+ result.setItems(HeapVector<PaymentItem>(1, item));
result.setShippingOptions(HeapVector<ShippingOption>(2, shippingOption));
return result;

Powered by Google App Engine
This is Rietveld 408576698