| Index: test/BaseJsTest.h |
| =================================================================== |
| --- a/test/BaseJsTest.h |
| +++ b/test/BaseJsTest.h |
| @@ -17,20 +17,21 @@ |
| #ifndef MOCKS_H |
| #define MOCKS_H |
| #include <AdblockPlus.h> |
| #include <gtest/gtest.h> |
| #include "../src/Thread.h" |
| -class ThrowingErrorCallback : public AdblockPlus::ErrorCallback |
| +class ThrowingLogSystem : public AdblockPlus::LogSystem |
| { |
| public: |
| - void operator()(const std::string& message) |
| + void operator()(LogLevel logLevel, const std::string& message, |
| + const std::string& source) |
| { |
| throw std::runtime_error("Unexpected error: " + message); |
| } |
| }; |
| class ThrowingFileSystem : public AdblockPlus::FileSystem |
| { |
| std::tr1::shared_ptr<std::istream> Read(const std::string& path) const |
| @@ -129,15 +130,15 @@ class LazyWebRequest : public AdblockPlu |
| class BaseJsTest : public ::testing::Test |
| { |
| protected: |
| AdblockPlus::JsEnginePtr jsEngine; |
| virtual void SetUp() |
| { |
| jsEngine = AdblockPlus::JsEngine::New(); |
| - jsEngine->SetErrorCallback(AdblockPlus::ErrorCallbackPtr(new ThrowingErrorCallback)); |
| + jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem)); |
| jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem)); |
| jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest)); |
| } |
| }; |
| #endif |