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*); | |
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 explicit MockFunction(ScriptState*, String *captor); | |
please use gerrit instead
2016/07/12 15:57:36
Remove "explicit" on this line. The keyword "expli
pals
2016/07/13 05:54:28
Done.
| |
77 v8::Local<v8::Function> bind(); | 80 v8::Local<v8::Function> bind(); |
78 MOCK_METHOD1(call, ScriptValue(ScriptValue)); | 81 // MOCK_METHOD1(call, ScriptValue(ScriptValue)); |
please use gerrit instead
2016/07/12 15:57:36
Leave MOCK_METHOD1() unmodified.
pals
2016/07/13 05:54:28
Done.
| |
82 ScriptValue call(ScriptValue value) override | |
please use gerrit instead
2016/07/12 15:57:36
Remove this method.
pals
2016/07/13 05:54:28
Done.
| |
83 { | |
84 *m_value = toCoreString(value.v8Value()->ToString(getScriptState()-> context()).ToLocalChecked()); | |
85 return value; | |
86 } | |
87 String* m_value; | |
79 }; | 88 }; |
80 | 89 |
81 ScriptState* m_scriptState; | 90 ScriptState* m_scriptState; |
82 Vector<Persistent<MockFunction>> m_mockFunctions; | 91 Vector<Persistent<MockFunction>> m_mockFunctions; |
83 }; | 92 }; |
84 | 93 |
85 } // namespace blink | 94 } // namespace blink |
86 | 95 |
87 #endif // PaymentTestHelper_h | 96 #endif // PaymentTestHelper_h |
OLD | NEW |