| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 return buildPaymentDetailsForTest(PaymentTestDetailError, PaymentTestDataNone, | 157 return buildPaymentDetailsForTest(PaymentTestDetailError, PaymentTestDataNone, |
| 158 PaymentTestOverwriteValue, valueToUse); | 158 PaymentTestOverwriteValue, valueToUse); |
| 159 } | 159 } |
| 160 | 160 |
| 161 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest() { | 161 HeapVector<PaymentMethodData> buildPaymentMethodDataForTest() { |
| 162 HeapVector<PaymentMethodData> methodData(1, PaymentMethodData()); | 162 HeapVector<PaymentMethodData> methodData(1, PaymentMethodData()); |
| 163 methodData[0].setSupportedMethods(Vector<String>(1, "foo")); | 163 methodData[0].setSupportedMethods(Vector<String>(1, "foo")); |
| 164 return methodData; | 164 return methodData; |
| 165 } | 165 } |
| 166 | 166 |
| 167 payments::mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() { | 167 mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() { |
| 168 payments::mojom::blink::PaymentResponsePtr result = | 168 mojom::blink::PaymentResponsePtr result = |
| 169 payments::mojom::blink::PaymentResponse::New(); | 169 mojom::blink::PaymentResponse::New(); |
| 170 return result; | 170 return result; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void makePaymentRequestOriginSecure(Document& document) { | 173 void makePaymentRequestOriginSecure(Document& document) { |
| 174 document.setSecurityOrigin( | 174 document.setSecurityOrigin( |
| 175 SecurityOrigin::create(KURL(KURL(), "https://www.example.com/"))); | 175 SecurityOrigin::create(KURL(KURL(), "https://www.example.com/"))); |
| 176 } | 176 } |
| 177 | 177 |
| 178 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope( | 178 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope( |
| 179 ScriptState* scriptState) | 179 ScriptState* scriptState) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 ON_CALL(*this, call(testing::_)) | 224 ON_CALL(*this, call(testing::_)) |
| 225 .WillByDefault( | 225 .WillByDefault( |
| 226 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>())); | 226 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>())); |
| 227 } | 227 } |
| 228 | 228 |
| 229 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() { | 229 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() { |
| 230 return bindToV8Function(); | 230 return bindToV8Function(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |