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 |