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 "bindings/core/v8/V8DOMException.h" | 9 #include "bindings/core/v8/V8DOMException.h" |
10 #include "components/payments/content/payment_request.mojom-blink.h" | 10 #include "components/payments/content/payment_request.mojom-blink.h" |
11 #include "modules/payments/PaymentDetailsInit.h" | 11 #include "modules/payments/PaymentDetails.h" |
12 #include "modules/payments/PaymentDetailsUpdate.h" | |
13 #include "modules/payments/PaymentItem.h" | 12 #include "modules/payments/PaymentItem.h" |
14 #include "modules/payments/PaymentShippingOption.h" | 13 #include "modules/payments/PaymentShippingOption.h" |
15 #include "platform/heap/HeapAllocator.h" | 14 #include "platform/heap/HeapAllocator.h" |
16 #include "platform/heap/Persistent.h" | 15 #include "platform/heap/Persistent.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "wtf/Allocator.h" | 17 #include "wtf/Allocator.h" |
19 #include "wtf/Vector.h" | 18 #include "wtf/Vector.h" |
20 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
21 | 20 |
22 namespace blink { | 21 namespace blink { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 PaymentTestDataToChange = PaymentTestDataNone, | 59 PaymentTestDataToChange = PaymentTestDataNone, |
61 PaymentTestModificationType = PaymentTestOverwriteValue, | 60 PaymentTestModificationType = PaymentTestOverwriteValue, |
62 const String& valueToUse = String()); | 61 const String& valueToUse = String()); |
63 | 62 |
64 PaymentDetailsModifier buildPaymentDetailsModifierForTest( | 63 PaymentDetailsModifier buildPaymentDetailsModifierForTest( |
65 PaymentTestDetailToChange = PaymentTestDetailNone, | 64 PaymentTestDetailToChange = PaymentTestDetailNone, |
66 PaymentTestDataToChange = PaymentTestDataNone, | 65 PaymentTestDataToChange = PaymentTestDataNone, |
67 PaymentTestModificationType = PaymentTestOverwriteValue, | 66 PaymentTestModificationType = PaymentTestOverwriteValue, |
68 const String& valueToUse = String()); | 67 const String& valueToUse = String()); |
69 | 68 |
70 PaymentDetailsInit buildPaymentDetailsInitForTest( | 69 PaymentDetails buildPaymentDetailsForTest( |
71 PaymentTestDetailToChange = PaymentTestDetailNone, | 70 PaymentTestDetailToChange = PaymentTestDetailNone, |
72 PaymentTestDataToChange = PaymentTestDataNone, | 71 PaymentTestDataToChange = PaymentTestDataNone, |
73 PaymentTestModificationType = PaymentTestOverwriteValue, | 72 PaymentTestModificationType = PaymentTestOverwriteValue, |
74 const String& valueToUse = String()); | 73 const String& valueToUse = String()); |
75 | 74 |
76 PaymentDetailsUpdate buildPaymentDetailsUpdateForTest( | 75 PaymentDetails buildPaymentDetailsErrorMsgForTest( |
77 PaymentTestDetailToChange = PaymentTestDetailNone, | |
78 PaymentTestDataToChange = PaymentTestDataNone, | |
79 PaymentTestModificationType = PaymentTestOverwriteValue, | |
80 const String& valueToUse = String()); | |
81 | |
82 PaymentDetailsUpdate buildPaymentDetailsErrorMsgForTest( | |
83 const String& valueToUse = String()); | 76 const String& valueToUse = String()); |
84 | 77 |
85 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest(); | 78 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest(); |
86 | 79 |
87 payments::mojom::blink::PaymentResponsePtr buildPaymentResponseForTest(); | 80 payments::mojom::blink::PaymentResponsePtr buildPaymentResponseForTest(); |
88 | 81 |
89 void makePaymentRequestOriginSecure(Document&); | 82 void makePaymentRequestOriginSecure(Document&); |
90 | 83 |
91 class PaymentRequestMockFunctionScope { | 84 class PaymentRequestMockFunctionScope { |
92 STACK_ALLOCATED(); | 85 STACK_ALLOCATED(); |
(...skipping 16 matching lines...) Expand all Loading... |
109 String* m_value; | 102 String* m_value; |
110 }; | 103 }; |
111 | 104 |
112 ScriptState* m_scriptState; | 105 ScriptState* m_scriptState; |
113 Vector<Persistent<MockFunction>> m_mockFunctions; | 106 Vector<Persistent<MockFunction>> m_mockFunctions; |
114 }; | 107 }; |
115 | 108 |
116 } // namespace blink | 109 } // namespace blink |
117 | 110 |
118 #endif // PaymentTestHelper_h | 111 #endif // PaymentTestHelper_h |
OLD | NEW |