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

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

Issue 2145553002: Parameterize OnError method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Parameterize OnError method. Created 4 years, 5 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/PaymentTestHelper.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
index 1d2293ef7873e3b0d35642af25933e4ff78a6c85..78eb279927005826d1b7845c41953ba2a742db55 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp
@@ -153,24 +153,36 @@ PaymentRequestMockFunctionScope::~PaymentRequestMockFunctionScope()
}
}
+v8::Local<v8::Function> PaymentRequestMockFunctionScope::expectCall(String* captor)
+{
+ m_mockFunctions.append(new MockFunction(m_scriptState, captor));
+ return m_mockFunctions.last()->bind();
+}
+
v8::Local<v8::Function> PaymentRequestMockFunctionScope::expectCall()
{
m_mockFunctions.append(new MockFunction(m_scriptState));
- EXPECT_CALL(*m_mockFunctions.last(), call(testing::_));
+ // EXPECT_CALL(*m_mockFunctions.last(), call(testing::_));
pals 2016/07/12 11:42:56 As we have overridden the "call" method, EXPECT_CA
pals 2016/07/12 11:45:01 [1] https://cs.chromium.org/chromium/src/third_par
please use gerrit instead 2016/07/12 15:57:35 Uncomment
pals 2016/07/13 05:54:27 Done.
return m_mockFunctions.last()->bind();
}
v8::Local<v8::Function> PaymentRequestMockFunctionScope::expectNoCall()
{
m_mockFunctions.append(new MockFunction(m_scriptState));
- EXPECT_CALL(*m_mockFunctions.last(), call(testing::_)).Times(0);
+ // EXPECT_CALL(*m_mockFunctions.last(), call(testing::_)).Times(0);
please use gerrit instead 2016/07/12 15:57:35 Uncomment
pals 2016/07/13 05:54:28 Done.
return m_mockFunctions.last()->bind();
}
please use gerrit instead 2016/07/12 15:57:35 Put the following code before MockFunction() const
pals 2016/07/13 05:54:28 Nice. Thank you. Done. Thanks
PaymentRequestMockFunctionScope::MockFunction::MockFunction(ScriptState* scriptState)
: ScriptFunction(scriptState)
{
- ON_CALL(*this, call(testing::_)).WillByDefault(testing::ReturnArg<0>());
+ // ON_CALL(*this, call(testing::_)).WillByDefault(testing::ReturnArg<0>());
please use gerrit instead 2016/07/12 15:57:35 Change this line to the following: ON_CALL(*this,
pals 2016/07/13 05:54:27 Done.
+}
+
+PaymentRequestMockFunctionScope::MockFunction::MockFunction(ScriptState* scriptState, String* captor)
+ : ScriptFunction(scriptState)
+ , m_value(captor)
+{
}
v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind()

Powered by Google App Engine
This is Rietveld 408576698