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

Unified Diff: test/FilterEngine.cpp

Issue 29367522: Issue #4688, #3595 - Web request use scheduled threads; unit tests terminate
Patch Set: Created Dec. 14, 2016, 8:38 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
Index: test/FilterEngine.cpp
===================================================================
--- a/test/FilterEngine.cpp
+++ b/test/FilterEngine.cpp
@@ -36,17 +36,28 @@
template<class FileSystem, class LogSystem>
class FilterEngineTestGeneric : public BaseJsTest
{
+
protected:
FilterEnginePtr filterEngine;
+ std::shared_ptr<LazyWebRequest> webRequest;
void SetUp()
{
BaseJsTest::SetUp();
jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new FileSystem));
- jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest));
+ webRequest = std::make_shared<LazyWebRequest>();
+ jsEngine->SetWebRequest(webRequest);
jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LogSystem));
filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine));
}
+
+ void TearDown()
+ {
+ if (webRequest)
+ {
+ webRequest->Cancel();
+ }
+ }
};
typedef FilterEngineTestGeneric<LazyFileSystem, AdblockPlus::DefaultLogSystem> FilterEngineTest;

Powered by Google App Engine
This is Rietveld