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

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

Issue 1938853002: More thorough tests for PaymentRequest (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..a6571b2a16684bf11c2809f4f7d77771562d59f1 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -293,8 +293,8 @@ PaymentRequest::PaymentRequest(ScriptState* scriptState, const Vector<String>& s
}
}
- // Set the currently selected option if only one option was passed.
- if (details.hasShippingOptions() && details.shippingOptions().size() == 1)
+ // Set the currently selected option if only one option is passed and shipping is requested.
+ if (options.requestShipping() && details.hasShippingOptions() && details.shippingOptions().size() == 1)
m_shippingOption = details.shippingOptions().begin()->id();
}

Powered by Google App Engine
This is Rietveld 408576698