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

Unified Diff: test/WebRequest.cpp

Issue 29499583: Issue 4938 - fix race conditions related to LazyFileSystem (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 27, 2017, 8:53 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
« test/FilterEngine.cpp ('K') | « test/UpdateCheck.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/WebRequest.cpp
diff --git a/test/WebRequest.cpp b/test/WebRequest.cpp
index 5037feb001b59ea675a57a3a693469740119f824..a445d93dff10272639fc6d8dc5caf4c6ef8c7c04 100644
--- a/test/WebRequest.cpp
+++ b/test/WebRequest.cpp
@@ -33,7 +33,7 @@ namespace
JsEngineCreationParameters jsEngineParams;
jsEngineParams.logSystem = CreateLogSystem();
jsEngineParams.timer.reset(new NoopTimer());
- jsEngineParams.fileSystem.reset(new LazyFileSystem());
+ jsEngineParams.fileSystem.reset(fileSystem = new LazyFileSystem());
jsEngineParams.webRequest = CreateWebRequest();
jsEngine = CreateJsEngine(std::move(jsEngineParams));
}
@@ -49,6 +49,7 @@ namespace
}
JsEnginePtr jsEngine;
+ LazyFileSystem* fileSystem;
};
class MockWebRequestTest : public DefaultWebRequestTest
@@ -178,7 +179,7 @@ TEST_F(DefaultWebRequestTest, RealWebRequest)
TEST_F(DefaultWebRequestTest, XMLHttpRequest)
{
- auto filterEngine = AdblockPlus::FilterEngine::Create(jsEngine);
+ auto filterEngine = CreateFilterEngine(*fileSystem, jsEngine);
ResetTestXHR(jsEngine, "https://easylist-downloads.adblockplus.org/easylist.txt");
jsEngine->Evaluate("\
@@ -208,7 +209,7 @@ TEST_F(DefaultWebRequestTest, DummyWebRequest)
TEST_F(DefaultWebRequestTest, XMLHttpRequest)
{
- auto filterEngine = AdblockPlus::FilterEngine::Create(jsEngine);
+ auto filterEngine = CreateFilterEngine(*fileSystem, jsEngine);
ResetTestXHR(jsEngine);
jsEngine->Evaluate("\
@@ -264,7 +265,7 @@ namespace
TEST_F(MockWebRequestAndLogSystemTest, RequestHeaderValidation)
{
- auto filterEngine = AdblockPlus::FilterEngine::Create(jsEngine);
+ auto filterEngine = CreateFilterEngine(*fileSystem, jsEngine);
const std::string msg = "Attempt to set a forbidden header was denied: ";
« test/FilterEngine.cpp ('K') | « test/UpdateCheck.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld