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

Unified Diff: test/JsEngine.cpp

Issue 5653480979038208: Issue 2325 - Add a way to set settings in libadblockplus for FRP and automatic updates (Closed)
Patch Set: Simplify the setting of global property. Add more tests. Created June 12, 2015, 7:33 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
Index: test/JsEngine.cpp
===================================================================
--- a/test/JsEngine.cpp
+++ b/test/JsEngine.cpp
@@ -124,3 +124,13 @@
jsEngine->SetWebRequest(webRequest);
ASSERT_EQ(webRequest, jsEngine->GetWebRequest());
}
+
+TEST(NewJsEngineTest, GlobalPropertyTest)
+{
+ AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New());
+ jsEngine->SetGlobalProperty("foo", jsEngine->NewValue("bar"));
+ AdblockPlus::JsValuePtr foo = jsEngine->Evaluate("foo");
+ ASSERT_TRUE(foo->IsString());
+ ASSERT_EQ(foo->AsString(), "bar");
+}
+

Powered by Google App Engine
This is Rietveld