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 #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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest() | 97 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest() |
98 { | 98 { |
99 HeapVector<PaymentMethodData> methodData(1, PaymentMethodData()); | 99 HeapVector<PaymentMethodData> methodData(1, PaymentMethodData()); |
100 methodData[0].setSupportedMethods(Vector<String>(1, "foo")); | 100 methodData[0].setSupportedMethods(Vector<String>(1, "foo")); |
101 return methodData; | 101 return methodData; |
102 } | 102 } |
103 | 103 |
104 mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() | 104 mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() |
105 { | 105 { |
106 mojom::blink::PaymentResponsePtr result = mojom::blink::PaymentResponse::New
(); | 106 mojom::blink::PaymentResponsePtr result = mojom::blink::PaymentResponse::New
(); |
107 result->total_amount = mojom::blink::PaymentCurrencyAmount::New(); | |
108 return result; | 107 return result; |
109 } | 108 } |
110 | 109 |
111 void makePaymentRequestOriginSecure(Document& document) | 110 void makePaymentRequestOriginSecure(Document& document) |
112 { | 111 { |
113 document.setSecurityOrigin(SecurityOrigin::create(KURL(KURL(), "https://www.
example.com/"))); | 112 document.setSecurityOrigin(SecurityOrigin::create(KURL(KURL(), "https://www.
example.com/"))); |
114 } | 113 } |
115 | 114 |
116 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope(ScriptState* sc
riptState) | 115 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope(ScriptState* sc
riptState) |
117 : m_scriptState(scriptState) | 116 : m_scriptState(scriptState) |
(...skipping 27 matching lines...) Expand all Loading... |
145 { | 144 { |
146 ON_CALL(*this, call(testing::_)).WillByDefault(testing::ReturnArg<0>()); | 145 ON_CALL(*this, call(testing::_)).WillByDefault(testing::ReturnArg<0>()); |
147 } | 146 } |
148 | 147 |
149 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() | 148 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() |
150 { | 149 { |
151 return bindToV8Function(); | 150 return bindToV8Function(); |
152 } | 151 } |
153 | 152 |
154 } // namespace blink | 153 } // namespace blink |
OLD | NEW |