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

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

Issue 1938843002: More thorough tests for PaymentDetails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-output-dir
Patch Set: Address comments 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/PaymentRequest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
index ea50249f3b32d5982c004280615331f9d82c4128..4cf7359cae81c47b1d2150f335a2597e7a659577 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -108,12 +108,12 @@ void validateShippingOptionsOrPaymentItems(HeapVector<T> items, ExceptionState&
{
String errorMessage;
for (const auto& item : items) {
- if (!item.hasId()) {
+ if (!item.hasId() || item.id().isEmpty()) {
exceptionState.throwTypeError("Item id required");
return;
}
- if (!item.hasLabel()) {
+ if (!item.hasLabel() || item.label().isEmpty()) {
exceptionState.throwTypeError("Item label required");
return;
}

Powered by Google App Engine
This is Rietveld 408576698