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

Unified Diff: third_party/WebKit/Source/modules/payments/MockFunction.cpp

Issue 2048823004: PaymentRequest.abort() should return a promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/payments/MockFunction.cpp
diff --git a/third_party/WebKit/Source/modules/payments/MockFunction.cpp b/third_party/WebKit/Source/modules/payments/MockFunction.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d20b10660125804d8d95b123a000d0d2dc3aa86f
--- /dev/null
+++ b/third_party/WebKit/Source/modules/payments/MockFunction.cpp
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/payments/MockFunction.h"
+
+namespace blink {
+
+v8::Local<v8::Function> MockFunction::noExpectations(ScriptState* scriptState)
+{
+ MockFunction* self = new MockFunction(scriptState);
+ return self->bindToV8Function();
+}
+
+v8::Local<v8::Function> MockFunction::expectCall(ScriptState* scriptState)
+{
+ MockFunction* self = new MockFunction(scriptState);
+ EXPECT_CALL(*self, call(testing::_));
+ return self->bindToV8Function();
+}
+
+v8::Local<v8::Function> MockFunction::expectNoCall(ScriptState* scriptState)
+{
+ MockFunction* self = new MockFunction(scriptState);
+ EXPECT_CALL(*self, call(testing::_)).Times(0);
+ return self->bindToV8Function();
+}
+
+MockFunction::MockFunction(ScriptState* scriptState)
+ : ScriptFunction(scriptState)
+{
+ ON_CALL(*this, call(testing::_)).WillByDefault(testing::ReturnArg<0>());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698