Index: test/JsEngine.cpp |
=================================================================== |
--- a/test/JsEngine.cpp |
+++ b/test/JsEngine.cpp |
@@ -67,7 +67,7 @@ |
TEST(JsEngineTest, EvaluateAndCall) |
{ |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(0, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), 0, 0, &errorCallback); |
const std::string source = "function hello() { return 'Hello'; }"; |
jsEngine.Evaluate(source); |
AdblockPlus::JsValuePtr result = jsEngine.Evaluate("hello()"); |
@@ -79,7 +79,8 @@ |
{ |
StubFileSystem fileSystem; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileSystem, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileSystem, 0, |
+ &errorCallback); |
jsEngine.Load("hello.js"); |
AdblockPlus::JsValuePtr result = jsEngine.Evaluate("hello()"); |
ASSERT_TRUE(result->IsString()); |
@@ -90,28 +91,29 @@ |
{ |
BadFileSystem fileSystem; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileSystem, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), &fileSystem, 0, |
+ &errorCallback); |
ASSERT_ANY_THROW(jsEngine.Load("hello.js")); |
} |
TEST(JsEngineTest, RuntimeExceptionIsThrown) |
{ |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(0, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), 0, 0, &errorCallback); |
ASSERT_THROW(jsEngine.Evaluate("doesnotexist()"), AdblockPlus::JsError); |
} |
TEST(JsEngineTest, CompileTimeExceptionIsThrown) |
{ |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(0, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), 0, 0, &errorCallback); |
ASSERT_THROW(jsEngine.Evaluate("'foo'bar'"), AdblockPlus::JsError); |
} |
TEST(JsEngineTest, ValueCreation) |
{ |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(0, 0, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(AdblockPlus::AppInfo(), 0, 0, &errorCallback); |
AdblockPlus::JsValuePtr value; |
value = jsEngine.NewValue("foo"); |