Index: base/test/test_suite.cc |
=================================================================== |
--- base/test/test_suite.cc (revision 114513) |
+++ base/test/test_suite.cc (working copy) |
@@ -72,6 +72,19 @@ |
const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling"; |
TestSuite::TestSuite(int argc, char** argv) { |
+ PreInitialize(argc, argv, true); |
+} |
+ |
+TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager) { |
+ PreInitialize(argc, argv, create_at_exit_manager); |
+} |
+ |
+TestSuite::~TestSuite() { |
+ CommandLine::Reset(); |
+} |
+ |
+void TestSuite::PreInitialize(int argc, char** argv, |
+ bool create_at_exit_manager) { |
#if defined(OS_WIN) |
testing::GTEST_FLAG(catch_exceptions) = false; |
#endif |
@@ -86,13 +99,13 @@ |
#elif defined(TOOLKIT_USES_GTK) |
gtk_init_check(&argc, &argv); |
#endif // defined(TOOLKIT_USES_GTK) |
- // Don't add additional code to this constructor. Instead add it to |
+ if (create_at_exit_manager) { |
brettw
2011/12/15 00:00:15
No {} to match surrounding code.
ananta
2011/12/15 00:14:55
Done.
|
+ at_exit_manager_.reset(new base::AtExitManager); |
+ } |
+ // Don't add additional code to this function. Instead add it to |
// Initialize(). See bug 6436. |
} |
-TestSuite::~TestSuite() { |
- CommandLine::Reset(); |
-} |
// static |
bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) { |