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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp

Issue 2410143003: Add currencySystem field to PaymentCurrencyAmount (Closed)
Patch Set: Add currencySystem field to PaymentCurrencyAmount Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/payments/PaymentTestHelper.h" 5 #include "modules/payments/PaymentTestHelper.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "modules/payments/PaymentCurrencyAmount.h" 9 #include "modules/payments/PaymentCurrencyAmount.h"
10 #include "modules/payments/PaymentMethodData.h" 10 #include "modules/payments/PaymentMethodData.h"
(...skipping 10 matching lines...) Expand all
21 PaymentTestDataToChange data, 21 PaymentTestDataToChange data,
22 PaymentTestModificationType modificationType, 22 PaymentTestModificationType modificationType,
23 const String& valueToUse) { 23 const String& valueToUse) {
24 PaymentCurrencyAmount itemAmount; 24 PaymentCurrencyAmount itemAmount;
25 if (data == PaymentTestDataCurrencyCode) { 25 if (data == PaymentTestDataCurrencyCode) {
26 if (modificationType == PaymentTestOverwriteValue) 26 if (modificationType == PaymentTestOverwriteValue)
27 itemAmount.setCurrency(valueToUse); 27 itemAmount.setCurrency(valueToUse);
28 } else { 28 } else {
29 itemAmount.setCurrency("USD"); 29 itemAmount.setCurrency("USD");
30 } 30 }
31
32 if (data == PaymentTestDataCurrencySystem)
33 itemAmount.setCurrencySystem("http://www.example.com");
please use gerrit instead 2016/10/13 17:37:54 // Currency system is "urn:iso:std:iso:4217" by de
pals 2016/10/14 14:41:21 Done.
34
31 if (data == PaymentTestDataValue) { 35 if (data == PaymentTestDataValue) {
32 if (modificationType == PaymentTestOverwriteValue) 36 if (modificationType == PaymentTestOverwriteValue)
33 itemAmount.setValue(valueToUse); 37 itemAmount.setValue(valueToUse);
34 } else { 38 } else {
35 itemAmount.setValue("9.99"); 39 itemAmount.setValue("9.99");
36 } 40 }
37 41
38 if (data != PaymentTestDataAmount || modificationType != PaymentTestRemoveKey) 42 if (data != PaymentTestDataAmount || modificationType != PaymentTestRemoveKey)
39 original.setAmount(itemAmount); 43 original.setAmount(itemAmount);
40 44
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ON_CALL(*this, call(testing::_)) 219 ON_CALL(*this, call(testing::_))
216 .WillByDefault( 220 .WillByDefault(
217 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>())); 221 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>()));
218 } 222 }
219 223
220 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() { 224 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() {
221 return bindToV8Function(); 225 return bindToV8Function();
222 } 226 }
223 227
224 } // namespace blink 228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698