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

Unified Diff: test/UpdateCheck.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/Prefs.cpp ('k') | test/WebRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/UpdateCheck.cpp
diff --git a/test/UpdateCheck.cpp b/test/UpdateCheck.cpp
index d5ddf4e917db775ae193c49dc2b2a537f241c163..8b520ceabb7259598ff0b04121bbfec45add6bc0 100644
--- a/test/UpdateCheck.cpp
+++ b/test/UpdateCheck.cpp
@@ -50,8 +50,7 @@ namespace
{
protected:
AdblockPlus::AppInfo appInfo;
- TestWebRequest* webRequest;
- WebRequestSharedPtr webRequestPtr;
+ std::shared_ptr<TestWebRequest> webRequest;
AdblockPlus::JsEnginePtr jsEngine;
FilterEnginePtr filterEngine;
@@ -62,8 +61,7 @@ namespace
void SetUp()
{
- webRequest = new TestWebRequest();
- webRequestPtr.reset(webRequest);
+ webRequest = std::make_shared<TestWebRequest>();
eventCallbackCalled = false;
updateCallbackCalled = false;
@@ -72,10 +70,13 @@ namespace
void Reset()
{
- jsEngine = CreateJsEngine(appInfo);
- jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem));
- jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new LazyFileSystem));
- jsEngine->SetWebRequest(webRequestPtr);
+ JsEngineCreationParameters jsEngineParams;
+ jsEngineParams.appInfo = appInfo;
+ jsEngineParams.logSystem.reset(new LazyLogSystem());
+ jsEngineParams.fileSystem.reset(new LazyFileSystem());
+ jsEngineParams.timer = CreateDefaultTimer();
+ jsEngine = CreateJsEngine(std::move(jsEngineParams));
+ jsEngine->SetWebRequest(webRequest);
jsEngine->SetEventCallback("updateAvailable", [this](JsValueList&& params)
{
eventCallbackCalled = true;
« no previous file with comments | « test/Prefs.cpp ('k') | test/WebRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld