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

Unified Diff: test/JsValue.cpp

Issue 29393589: Issue 5013 - Make more methods const.- introduced JsConstValuePtr and JsConstValueList- JsValue:… (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Rebased on master Created March 24, 2017, 2:40 p.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/WebRequestJsObject.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
===================================================================
--- a/test/JsValue.cpp
+++ b/test/JsValue.cpp
@@ -194,26 +194,26 @@ TEST_F(JsValueTest, FunctionValue)
ASSERT_TRUE(value->IsObject());
ASSERT_FALSE(value->IsArray());
ASSERT_TRUE(value->IsFunction());
ASSERT_TRUE(value->AsBool());
ASSERT_ANY_THROW(value->AsList());
ASSERT_EQ(2, value->GetProperty("length")->AsInt());
AdblockPlus::JsValuePtr thisPtr = jsEngine->Evaluate("({x:2})");
- AdblockPlus::JsValueList params;
+ AdblockPlus::JsConstValueList params;
params.push_back(jsEngine->NewValue(5));
params.push_back(jsEngine->NewValue("xyz"));
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());
+ EXPECT_EQ(10, func->Call(jsEngine->NewValue(5))->AsInt());
}
TEST_F(JsValueTest, ThrowingCoversion)
{
const std::string source("\
function Foo() {\
this.toString = function() {throw 'test1';};\
this.valueOf = function() {throw 'test2';};\
« no previous file with comments | « src/WebRequestJsObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld