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

Unified Diff: test/JsEngine.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') | « test/GlobalJsObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/JsEngine.cpp
===================================================================
--- a/test/JsEngine.cpp
+++ b/test/JsEngine.cpp
@@ -47,7 +47,8 @@
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileReader, 0,
+ &errorCallback);
const std::string source = "function hello() { return 'Hello'; }";
jsEngine.Evaluate(source);
const std::string result = jsEngine.Evaluate("hello()");
@@ -58,7 +59,8 @@
{
StubFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileReader, 0,
+ &errorCallback);
jsEngine.Load("hello.js");
const std::string result = jsEngine.Evaluate("hello()");
ASSERT_EQ("Hello", result);
@@ -68,7 +70,8 @@
{
BadFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileReader, 0,
+ &errorCallback);
ASSERT_ANY_THROW(jsEngine.Load("hello.js"));
}
@@ -76,7 +79,8 @@
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileReader, 0,
+ &errorCallback);
ASSERT_THROW(jsEngine.Evaluate("doesnotexist()"), AdblockPlus::JsError);
}
@@ -84,6 +88,7 @@
{
ThrowingFileReader fileReader;
ThrowingErrorCallback errorCallback;
- AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback);
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileReader, 0,
+ &errorCallback);
ASSERT_THROW(jsEngine.Evaluate("'foo'bar'"), AdblockPlus::JsError);
}
« lib/info.js ('K') | « test/GlobalJsObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld