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 "modules/payments/PaymentDetails.h" | 10 #include "modules/payments/PaymentDetails.h" |
10 #include "modules/payments/PaymentItem.h" | 11 #include "modules/payments/PaymentItem.h" |
11 #include "modules/payments/PaymentShippingOption.h" | 12 #include "modules/payments/PaymentShippingOption.h" |
12 #include "platform/heap/HeapAllocator.h" | 13 #include "platform/heap/HeapAllocator.h" |
13 #include "platform/heap/Persistent.h" | 14 #include "platform/heap/Persistent.h" |
14 #include "public/platform/modules/payments/payment_request.mojom-blink.h" | 15 #include "public/platform/modules/payments/payment_request.mojom-blink.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "wtf/Allocator.h" | 17 #include "wtf/Allocator.h" |
17 #include "wtf/Vector.h" | 18 #include "wtf/Vector.h" |
18 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 62 |
62 void makePaymentRequestOriginSecure(Document&); | 63 void makePaymentRequestOriginSecure(Document&); |
63 | 64 |
64 class PaymentRequestMockFunctionScope { | 65 class PaymentRequestMockFunctionScope { |
65 STACK_ALLOCATED(); | 66 STACK_ALLOCATED(); |
66 public: | 67 public: |
67 explicit PaymentRequestMockFunctionScope(ScriptState*); | 68 explicit PaymentRequestMockFunctionScope(ScriptState*); |
68 ~PaymentRequestMockFunctionScope(); | 69 ~PaymentRequestMockFunctionScope(); |
69 | 70 |
70 v8::Local<v8::Function> expectCall(); | 71 v8::Local<v8::Function> expectCall(); |
| 72 v8::Local<v8::Function> expectCall(String* captor); |
71 v8::Local<v8::Function> expectNoCall(); | 73 v8::Local<v8::Function> expectNoCall(); |
72 | 74 |
73 private: | 75 private: |
74 class MockFunction : public ScriptFunction { | 76 class MockFunction : public ScriptFunction { |
75 public: | 77 public: |
76 explicit MockFunction(ScriptState*); | 78 explicit MockFunction(ScriptState*); |
| 79 MockFunction(ScriptState*, String* captor); |
77 v8::Local<v8::Function> bind(); | 80 v8::Local<v8::Function> bind(); |
78 MOCK_METHOD1(call, ScriptValue(ScriptValue)); | 81 MOCK_METHOD1(call, ScriptValue(ScriptValue)); |
| 82 String* m_value; |
79 }; | 83 }; |
80 | 84 |
81 ScriptState* m_scriptState; | 85 ScriptState* m_scriptState; |
82 Vector<Persistent<MockFunction>> m_mockFunctions; | 86 Vector<Persistent<MockFunction>> m_mockFunctions; |
83 }; | 87 }; |
84 | 88 |
85 } // namespace blink | 89 } // namespace blink |
86 | 90 |
87 #endif // PaymentTestHelper_h | 91 #endif // PaymentTestHelper_h |
OLD | NEW |