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

Unified Diff: test/UpdateCheck.cpp

Issue 29442626: Noissue - remove JsEngine as a member of UpdateCheckTest (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created May 19, 2017, 4:50 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
« no previous file with comments | « no previous file | no next file » | 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 22653ba47ba215e7a7b1f7468ce69b2bbe7d2a12..5e2a6c8ff462d835e42162295be27b4128aed09e 100644
--- a/test/UpdateCheck.cpp
+++ b/test/UpdateCheck.cpp
@@ -38,7 +38,6 @@ namespace
AdblockPlus::ServerResponse webRequestResponse;
DelayedWebRequest::SharedTasks webRequestTasks;
DelayedTimer::SharedTasks timerTasks;
- AdblockPlus::JsEnginePtr jsEngine;
FilterEnginePtr filterEngine;
bool eventCallbackCalled;
@@ -60,7 +59,7 @@ namespace
jsEngineParams.fileSystem.reset(new LazyFileSystem());
jsEngineParams.timer = DelayedTimer::New(timerTasks);
jsEngineParams.webRequest = DelayedWebRequest::New(webRequestTasks);
- jsEngine = CreateJsEngine(std::move(jsEngineParams));
+ auto jsEngine = CreateJsEngine(std::move(jsEngineParams));
jsEngine->SetEventCallback("updateAvailable", [this](JsValueList&& params)
{
eventCallbackCalled = true;
@@ -120,8 +119,8 @@ TEST_F(UpdateCheckTest, RequestFailure)
ASSERT_FALSE(updateError.empty());
std::string expectedUrl(filterEngine->GetPref("update_url_release").AsString());
- std::string platform = jsEngine->Evaluate("require('info').platform").AsString();
- std::string platformVersion = jsEngine->Evaluate("require('info').platformVersion").AsString();
+ std::string platform = filterEngine->GetJsEngine()->Evaluate("require('info').platform").AsString();
+ std::string platformVersion = filterEngine->GetJsEngine()->Evaluate("require('info').platformVersion").AsString();
FindAndReplace(expectedUrl, "%NAME%", appInfo.name);
FindAndReplace(expectedUrl, "%TYPE%", "1"); // manual update
@@ -159,8 +158,8 @@ TEST_F(UpdateCheckTest, UpdateAvailable)
ASSERT_TRUE(updateError.empty());
std::string expectedUrl(filterEngine->GetPref("update_url_devbuild").AsString());
- std::string platform = jsEngine->Evaluate("require('info').platform").AsString();
- std::string platformVersion = jsEngine->Evaluate("require('info').platformVersion").AsString();
+ std::string platform = filterEngine->GetJsEngine()->Evaluate("require('info').platform").AsString();
+ std::string platformVersion = filterEngine->GetJsEngine()->Evaluate("require('info').platformVersion").AsString();
FindAndReplace(expectedUrl, "%NAME%", appInfo.name);
FindAndReplace(expectedUrl, "%TYPE%", "1"); // manual update
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld