Index: test/JsEngine.cpp |
=================================================================== |
--- a/test/JsEngine.cpp |
+++ b/test/JsEngine.cpp |
@@ -42,48 +42,48 @@ public: |
return std::auto_ptr<std::istream>(file); |
} |
}; |
TEST(JsEngineTest, EvaluateAndCall) |
{ |
ThrowingFileReader fileReader; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback); |
const std::string source = "function hello() { return 'Hello'; }"; |
jsEngine.Evaluate(source); |
const std::string result = jsEngine.Call("hello"); |
ASSERT_EQ("Hello", result); |
} |
TEST(JsEngineTest, LoadAndCall) |
{ |
StubFileReader fileReader; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback); |
jsEngine.Load("hello.js"); |
const std::string result = jsEngine.Call("hello"); |
ASSERT_EQ("Hello", result); |
} |
TEST(JsEngineTest, LoadBadStreamFails) |
{ |
BadFileReader fileReader; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback); |
ASSERT_ANY_THROW(jsEngine.Load("hello.js")); |
} |
TEST(JsEngineTest, RuntimeExceptionIsThrown) |
{ |
ThrowingFileReader fileReader; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback); |
ASSERT_THROW(jsEngine.Evaluate("doesnotexist()"), AdblockPlus::JsError); |
} |
TEST(JsEngineTest, CompileTimeExceptionIsThrown) |
{ |
ThrowingFileReader fileReader; |
ThrowingErrorCallback errorCallback; |
- AdblockPlus::JsEngine jsEngine(&fileReader, &errorCallback); |
+ AdblockPlus::JsEngine jsEngine(&fileReader, 0, &errorCallback); |
ASSERT_THROW(jsEngine.Evaluate("'foo'bar'"), AdblockPlus::JsError); |
} |