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

Unified Diff: test/BaseJsTest.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/BaseJsTest.h ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/BaseJsTest.cpp
diff --git a/test/BaseJsTest.cpp b/test/BaseJsTest.cpp
index be82859cca26769e6c52137d3813b15e0768f2f7..c632ca186a0dd7d3da51edbc63d7858979aa49be 100644
--- a/test/BaseJsTest.cpp
+++ b/test/BaseJsTest.cpp
@@ -17,9 +17,22 @@
#include "BaseJsTest.h"
-AdblockPlus::JsEnginePtr CreateJsEngine(const AdblockPlus::AppInfo& appInfo,
- AdblockPlus::WebRequestPtr webRequest)
+JsEngineCreationParameters::JsEngineCreationParameters()
+ : logSystem(std::make_shared<ThrowingLogSystem>())
+ , timer(new ThrowingTimer())
+ , webRequest(new ThrowingWebRequest())
+ , fileSystem(std::make_shared<ThrowingFileSystem>())
+{
+}
+
+AdblockPlus::JsEnginePtr CreateJsEngine(JsEngineCreationParameters&& jsEngineCreationParameters)
{
static AdblockPlus::ScopedV8IsolatePtr isolate = std::make_shared<AdblockPlus::ScopedV8Isolate>();
- return AdblockPlus::JsEngine::New(appInfo, AdblockPlus::CreateDefaultTimer(), std::move(webRequest), isolate);
+ auto jsEngine = AdblockPlus::JsEngine::New(jsEngineCreationParameters.appInfo,
+ std::move(jsEngineCreationParameters.timer),
+ std::move(jsEngineCreationParameters.webRequest),
+ isolate);
+ jsEngine->SetLogSystem(std::move(jsEngineCreationParameters.logSystem));
+ jsEngine->SetFileSystem(std::move(jsEngineCreationParameters.fileSystem));
+ return jsEngine;
}
« no previous file with comments | « test/BaseJsTest.h ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld