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

Unified Diff: test/Prefs.cpp

Issue 29395627: Issue 5038 - fix usage of JsEngine in PrefsTests (Closed)
Patch Set: Created March 27, 2017, 9:50 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Prefs.cpp
diff --git a/test/Prefs.cpp b/test/Prefs.cpp
index 94568cdcb22e97186c06bf90677ee712a3b0c65c..3ef61e83c61a91001813129dafc93f95c7314730 100644
--- a/test/Prefs.cpp
+++ b/test/Prefs.cpp
@@ -74,6 +74,7 @@ namespace
{
fileSystem = new TestFileSystem();
fileSystemPtr.reset(fileSystem);
+ jsEngine = CreateJsEngine();
Reset();
}
@@ -81,7 +82,8 @@ namespace
void Reset(const AdblockPlus::FilterEngine::Prefs& preconfiguredPrefs =
AdblockPlus::FilterEngine::Prefs())
{
- jsEngine = CreateJsEngine();
+ if (!jsEngine)
+ jsEngine = CreateJsEngine();
jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem));
jsEngine->SetFileSystem(fileSystemPtr);
jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest));
@@ -197,6 +199,7 @@ TEST_F(PrefsTest, PrefsPersistWhenPreconfigured)
ASSERT_FALSE(fileSystem->prefsContents.empty());
+ jsEngine.reset();
Reset(preconfiguredPrefs);
ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld