Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequestTestBase.h

Issue 2048823004: PaymentRequest.abort() should return a promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DummyPageHolder and TrackExceptionState for haraken@ comment. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/ScriptFunction.h"
9 #include "bindings/core/v8/V8BindingForTesting.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/Vector.h"
14 #include "wtf/text/WTFString.h"
15
16 namespace blink {
17
18 class DummyPageHolder;
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 V8TestingScope m_scope;
45 Vector<Persistent<MockFunction>> m_mockFunctions;
46 };
47
48 } // namespace blink
49
50 #endif // PaymentRequestTestBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698