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

Unified Diff: test/AppInfoJsObject.cpp

Issue 10198022: Pass application data into libadblockplus (Closed)
Patch Set: Created April 12, 2013, 1:23 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
« lib/info.js ('K') | « src/JsEngine.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/AppInfoJsObject.cpp
===================================================================
new file mode 100644
--- /dev/null
+++ b/test/AppInfoJsObject.cpp
@@ -0,0 +1,18 @@
+#include <AdblockPlus.h>
+#include <gtest/gtest.h>
+
+TEST(AppInfoJsObjectTest, AllProperties)
+{
+ AdblockPlus::AppInfo appInfo;
+ appInfo.addonId = "1";
+ appInfo.addonVersion = "2";
+ appInfo.addonRoot = "3";
+ appInfo.addonName = "4";
+ appInfo.application = "5";
+ AdblockPlus::JsEngine jsEngine(appInfo, 0, 0, 0);
+ ASSERT_EQ("1", jsEngine.Evaluate("_appInfo.addonID"));
+ ASSERT_EQ("2", jsEngine.Evaluate("_appInfo.addonVersion"));
+ ASSERT_EQ("3", jsEngine.Evaluate("_appInfo.addonRoot"));
+ ASSERT_EQ("4", jsEngine.Evaluate("_appInfo.addonName"));
+ ASSERT_EQ("5", jsEngine.Evaluate("_appInfo.application"));
+}
« lib/info.js ('K') | « src/JsEngine.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld