Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/JsValue.cpp

Issue 29337850: Issue 3724 - Add JsValue::Call(const JsValue&) (Closed)
Patch Set: typo fix Created March 3, 2016, 11:20 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/JsValue.cpp
diff --git a/test/JsValue.cpp b/test/JsValue.cpp
index cbecfe0f7ce2c6d14646edafc50694de478609b9..4658b8b6cd9c99543464901e5188110effd7069c 100644
--- a/test/JsValue.cpp
+++ b/test/JsValue.cpp
@@ -205,6 +205,12 @@ TEST_F(JsValueTest, FunctionValue)
ASSERT_EQ("2/5/xyz", value->Call(params, thisPtr)->AsString());
}
+TEST_F(JsValueTest, JsValueCallSingleArg)
+{
+ auto func = jsEngine->Evaluate("(function(arg) {return arg * 2;})");
+ EXPECT_EQ(10, func->Call(*jsEngine->NewValue(5))->AsInt());
+}
+
TEST_F(JsValueTest, ThrowingCoversion)
{
const std::string source("\
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld