OLD | NEW |
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 #ifndef PaymentTestHelper_h | 5 #ifndef PaymentTestHelper_h |
6 #define PaymentTestHelper_h | 6 #define PaymentTestHelper_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "modules/payments/PaymentDetails.h" | 9 #include "modules/payments/PaymentDetails.h" |
10 #include "modules/payments/PaymentItem.h" | 10 #include "modules/payments/PaymentItem.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class Document; | 22 class Document; |
23 class PaymentMethodData; | 23 class PaymentMethodData; |
24 class ScriptState; | 24 class ScriptState; |
25 class ScriptValue; | 25 class ScriptValue; |
26 | 26 |
27 enum PaymentTestDetailToChange { | 27 enum PaymentTestDetailToChange { |
28 PaymentTestDetailNone, | 28 PaymentTestDetailNone, |
29 PaymentTestDetailTotal, | 29 PaymentTestDetailTotal, |
30 PaymentTestDetailItem, | 30 PaymentTestDetailItem, |
31 PaymentTestDetailShippingOption | 31 PaymentTestDetailShippingOption, |
| 32 PaymentTestDetailModifierTotal, |
| 33 PaymentTestDetailModifierItem |
32 }; | 34 }; |
33 | 35 |
34 enum PaymentTestDataToChange { | 36 enum PaymentTestDataToChange { |
35 PaymentTestDataNone, | 37 PaymentTestDataNone, |
36 PaymentTestDataId, | 38 PaymentTestDataId, |
37 PaymentTestDataLabel, | 39 PaymentTestDataLabel, |
38 PaymentTestDataAmount, | 40 PaymentTestDataAmount, |
39 PaymentTestDataCurrencyCode, | 41 PaymentTestDataCurrencyCode, |
40 PaymentTestDataValue, | 42 PaymentTestDataValue, |
41 }; | 43 }; |
42 | 44 |
43 enum PaymentTestModificationType { | 45 enum PaymentTestModificationType { |
44 PaymentTestOverwriteValue, | 46 PaymentTestOverwriteValue, |
45 PaymentTestRemoveKey | 47 PaymentTestRemoveKey |
46 }; | 48 }; |
47 | 49 |
48 PaymentItem buildPaymentItemForTest(PaymentTestDataToChange = PaymentTestDataNon
e, PaymentTestModificationType = PaymentTestOverwriteValue, const String& valueT
oUse = String()); | 50 PaymentItem buildPaymentItemForTest(PaymentTestDataToChange = PaymentTestDataNon
e, PaymentTestModificationType = PaymentTestOverwriteValue, const String& valueT
oUse = String()); |
49 | 51 |
50 PaymentShippingOption buildShippingOptionForTest(PaymentTestDataToChange = Payme
ntTestDataNone, PaymentTestModificationType = PaymentTestOverwriteValue, const S
tring& valueToUse = String()); | 52 PaymentShippingOption buildShippingOptionForTest(PaymentTestDataToChange = Payme
ntTestDataNone, PaymentTestModificationType = PaymentTestOverwriteValue, const S
tring& valueToUse = String()); |
51 | 53 |
| 54 PaymentDetailsModifier buildPaymentDetailsModifierForTest(PaymentTestDetailToCha
nge = PaymentTestDetailNone, PaymentTestDataToChange = PaymentTestDataNone, Paym
entTestModificationType = PaymentTestOverwriteValue, const String& valueToUse =
String()); |
| 55 |
52 PaymentDetails buildPaymentDetailsForTest(PaymentTestDetailToChange = PaymentTes
tDetailNone, PaymentTestDataToChange = PaymentTestDataNone, PaymentTestModificat
ionType = PaymentTestOverwriteValue, const String& valueToUse = String()); | 56 PaymentDetails buildPaymentDetailsForTest(PaymentTestDetailToChange = PaymentTes
tDetailNone, PaymentTestDataToChange = PaymentTestDataNone, PaymentTestModificat
ionType = PaymentTestOverwriteValue, const String& valueToUse = String()); |
53 | 57 |
54 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest(); | 58 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest(); |
55 | 59 |
56 mojom::blink::PaymentResponsePtr buildPaymentResponseForTest(); | 60 mojom::blink::PaymentResponsePtr buildPaymentResponseForTest(); |
57 | 61 |
58 void makePaymentRequestOriginSecure(Document&); | 62 void makePaymentRequestOriginSecure(Document&); |
59 | 63 |
60 class PaymentRequestMockFunctionScope { | 64 class PaymentRequestMockFunctionScope { |
61 STACK_ALLOCATED(); | 65 STACK_ALLOCATED(); |
(...skipping 12 matching lines...) Expand all Loading... |
74 MOCK_METHOD1(call, ScriptValue(ScriptValue)); | 78 MOCK_METHOD1(call, ScriptValue(ScriptValue)); |
75 }; | 79 }; |
76 | 80 |
77 ScriptState* m_scriptState; | 81 ScriptState* m_scriptState; |
78 Vector<Persistent<MockFunction>> m_mockFunctions; | 82 Vector<Persistent<MockFunction>> m_mockFunctions; |
79 }; | 83 }; |
80 | 84 |
81 } // namespace blink | 85 } // namespace blink |
82 | 86 |
83 #endif // PaymentTestHelper_h | 87 #endif // PaymentTestHelper_h |
OLD | NEW |