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

Unified Diff: test/Prefs.cpp

Issue 29433591: Issue 5180 - start to inject implementation of WebRequest into JsEngine::ctr (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created May 8, 2017, 11:59 a.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
« no previous file with comments | « test/Notification.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Prefs.cpp
diff --git a/test/Prefs.cpp b/test/Prefs.cpp
index 61fba8ed0c215136e4bb2ff16d5aba27b97b1e2e..5a011b319a9f616986a57aef5a3b0402b4f69344 100644
--- a/test/Prefs.cpp
+++ b/test/Prefs.cpp
@@ -20,6 +20,8 @@
#include "../src/Thread.h"
#include "BaseJsTest.h"
+using namespace AdblockPlus;
+
namespace
{
typedef std::shared_ptr<AdblockPlus::FilterEngine> FilterEnginePtr;
@@ -65,24 +67,23 @@ namespace
class PrefsTest : public ::testing::Test
{
protected:
- TestFileSystem* fileSystem;
- AdblockPlus::FileSystemPtr fileSystemPtr;
+ std::shared_ptr<TestFileSystem> fileSystem;
AdblockPlus::JsEnginePtr jsEngine;
void SetUp()
{
- fileSystem = new TestFileSystem();
- fileSystemPtr.reset(fileSystem);
-
+ fileSystem = std::make_shared<TestFileSystem>();
ResetJsEngine();
}
void ResetJsEngine()
{
- jsEngine = CreateJsEngine();
- jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem));
- jsEngine->SetFileSystem(fileSystemPtr);
- jsEngine->SetWebRequest(std::make_shared<LazyWebRequest>());
+ JsEngineCreationParameters jsEngineParams;
+ jsEngineParams.fileSystem = fileSystem;
+ jsEngineParams.webRequest.reset(new NoopWebRequest());
+ jsEngineParams.logSystem.reset(new LazyLogSystem());
+ jsEngineParams.timer.reset(new NoopTimer());
+ jsEngine = CreateJsEngine(std::move(jsEngineParams));
}
FilterEnginePtr CreateFilterEngine(const AdblockPlus::FilterEngine::Prefs& preconfiguredPrefs =
« no previous file with comments | « test/Notification.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld