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: Created March 3, 2016, 10:49 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..c1c9add641c1fa7d6b2d4f55ee3dcceb74ce8585 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, JsValueCallSignleArg)
+{
+ 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