Chromium Code Reviews| 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 "bindings/core/v8/V8BindingForTesting.h" | |
| 11 #include "platform/heap/Persistent.h" | |
| 12 #include "testing/gmock/include/gmock/gmock.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | |
| 14 #include "wtf/Vector.h" | |
| 15 #include "wtf/text/WTFString.h" | |
| 16 | |
| 17 namespace blink { | |
| 18 | |
| 19 class ScriptState; | |
| 20 | |
| 21 // A base fixture for PaymentRequest tests. | |
| 22 class PaymentRequestTestBase : public testing::Test { | |
| 23 public: | |
| 24 PaymentRequestTestBase(); | |
| 25 ~PaymentRequestTestBase() override; | |
| 26 | |
| 27 ScriptState* getScriptState(); | |
| 28 ExceptionState& getExceptionState(); | |
| 29 | |
| 30 void setSecurityOrigin(const String&); | |
| 31 | |
| 32 v8::Local<v8::Function> expectCall(); | |
| 33 v8::Local<v8::Function> expectNoCall(); | |
| 34 void firePromiseCallbacks(); | |
| 35 | |
| 36 private: | |
| 37 class MockFunction : public ScriptFunction { | |
| 38 public: | |
| 39 explicit MockFunction(ScriptState*); | |
| 40 v8::Local<v8::Function> bind(); | |
| 41 MOCK_METHOD1(call, ScriptValue(ScriptValue)); | |
| 42 }; | |
| 43 | |
| 44 ScriptStateForTestingWithPage m_scriptState; | |
| 45 TrackExceptionState m_exceptionState; | |
|
haraken
2016/06/13 01:31:10
V8TestingScope is an abstraction class that encaps
please use gerrit instead
2016/06/14 05:12:40
Done.
| |
| 46 Vector<Persistent<MockFunction>> m_mockFunctions; | |
| 47 }; | |
| 48 | |
| 49 } // namespace blink | |
| 50 | |
| 51 #endif // PaymentRequestTestBase_h | |
| OLD | NEW |