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

Unified Diff: test/Notification.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/GlobalJsObject.cpp ('k') | test/Prefs.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Notification.cpp
diff --git a/test/Notification.cpp b/test/Notification.cpp
index ef88576f2c50ff45729c3ace3adae1837e5db13d..64fa4560fc16c082ecfd67c21241c80a6652161c 100644
--- a/test/Notification.cpp
+++ b/test/Notification.cpp
@@ -27,22 +27,24 @@ namespace
{
typedef std::shared_ptr<FilterEngine> FilterEnginePtr;
- class NotificationTest : public BaseJsTest
+ class NotificationTest : public ::testing::Test
{
protected:
FilterEnginePtr filterEngine;
void SetUp()
{
- BaseJsTest::SetUp();
- jsEngine->SetFileSystem(FileSystemPtr(new LazyFileSystem()));
- jsEngine->SetWebRequest(std::make_shared<LazyWebRequest>());
- jsEngine->SetLogSystem(LogSystemPtr(new DefaultLogSystem()));
+ JsEngineCreationParameters jsEngineParams;
+ jsEngineParams.fileSystem.reset(new LazyFileSystem());
+ jsEngineParams.logSystem.reset(new DefaultLogSystem());
+ jsEngineParams.timer.reset(new NoopTimer());
+ jsEngineParams.webRequest.reset(new NoopWebRequest());
+ auto jsEngine = CreateJsEngine(std::move(jsEngineParams));
filterEngine = FilterEngine::Create(jsEngine);
}
void AddNotification(const std::string& notification)
{
- jsEngine->Evaluate("(function()"
+ filterEngine->GetJsEngine()->Evaluate("(function()"
"{"
"require('notification').Notification.addNotification(" + notification + ");"
"})();");
« no previous file with comments | « test/GlobalJsObject.cpp ('k') | test/Prefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld