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

Unified Diff: test/BaseJsTest.h

Issue 10524054: Rename ErrorCallback into LogSystem, provide a proper console API (Closed)
Patch Set: Created May 10, 2013, 2:01 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
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

Powered by Google App Engine
This is Rietveld