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

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

Issue 2532953006: Throw if PaymentRequest() built with 'error' message (Closed)
Patch Set: Created 4 years, 1 month 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 e9d25f51cc14e5113de6a172f69255e19d28a5e1..8f7d76a535b6970e0282ed072f3e68ca77bd1f83 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
@@ -138,17 +138,15 @@ PaymentDetails buildPaymentDetailsForTest(
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);
+
+ if (detail == PaymentTestDetailError)
+ result.setError(valueToUse);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698