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

Unified Diff: test/BaseJsTest.h

Issue 29508569: Issue 5450 - don't expose std::shared_ptr<JsEngine> (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 7, 2017, 8:39 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/AppInfoJsObject.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/BaseJsTest.h
diff --git a/test/BaseJsTest.h b/test/BaseJsTest.h
index a10e212fd76261bc98e28ee89314bf8b0ccba832..9b4926b28e614690adf89320daa70addd76e2e91 100644
--- a/test/BaseJsTest.h
+++ b/test/BaseJsTest.h
@@ -267,10 +267,23 @@ class BaseJsTest : public ::testing::Test
protected:
std::unique_ptr<AdblockPlus::Platform> platform;
- virtual void SetUp()
+ void SetUp() override
{
platform.reset(new AdblockPlus::Platform(ThrowingPlatformCreationParameters()));
}
+
+ AdblockPlus::JsEngine& GetJsEngine()
+ {
+ if (!platform)
+ throw std::runtime_error("Platform must be initialized");
+ return platform->GetJsEngine();
+ }
+
+ void TearDown() override
+ {
+ if (platform)
+ platform.reset();
+ }
};
#endif
« no previous file with comments | « test/AppInfoJsObject.cpp ('k') | test/ConsoleJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld