OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PaymentRequestTestBase_h | |
6 #define PaymentRequestTestBase_h | |
7 | |
8 #include "bindings/core/v8/ExceptionState.h" | |
9 #include "bindings/core/v8/ScriptFunction.h" | |
10 #include "platform/heap/Persistent.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | |
13 #include "wtf/OwnPtr.h" | |
14 #include "wtf/Vector.h" | |
15 #include "wtf/text/WTFString.h" | |
16 | |
17 namespace blink { | |
18 | |
19 class DummyPageHolder; | |
20 class ScriptState; | |
21 | |
22 // A base fixture for PaymentRequest tests. | |
23 class PaymentRequestTestBase : public testing::Test { | |
24 public: | |
25 PaymentRequestTestBase(); | |
26 ~PaymentRequestTestBase() override; | |
27 | |
28 ScriptState* getScriptState(); | |
29 ExceptionState& getExceptionState(); | |
30 | |
31 void setSecurityOrigin(const String&); | |
32 | |
33 v8::Local<v8::Function> expectCall(); | |
34 v8::Local<v8::Function> expectNoCall(); | |
35 void firePromiseCallbacks(); | |
36 | |
37 private: | |
38 class MockFunction : public ScriptFunction { | |
39 public: | |
40 explicit MockFunction(ScriptState*); | |
41 v8::Local<v8::Function> bind(); | |
42 MOCK_METHOD1(call, ScriptValue(ScriptValue)); | |
43 }; | |
44 | |
45 OwnPtr<DummyPageHolder> m_holder; | |
haraken
2016/06/14 05:24:35
Remove this?
please use gerrit instead
2016/06/15 04:13:19
Done.
| |
46 TrackExceptionState m_exceptionState; | |
haraken
2016/06/14 05:24:35
Remove this?
please use gerrit instead
2016/06/15 04:13:19
Done.
| |
47 Vector<Persistent<MockFunction>> m_mockFunctions; | |
48 }; | |
49 | |
50 } // namespace blink | |
51 | |
52 #endif // PaymentRequestTestBase_h | |
OLD | NEW |