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; |