| Index: base/test/test_suite.cc
|
| diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
|
| index cf04cafc2f0184df23b912e62842fbe29fb7f9f8..c538d6fe6d7d0d4a3639b10e9d2f7789697150b0 100644
|
| --- a/base/test/test_suite.cc
|
| +++ b/base/test/test_suite.cc
|
| @@ -71,16 +71,18 @@ class TestClientInitializer : public testing::EmptyTestEventListener {
|
|
|
| const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling";
|
|
|
| -TestSuite::TestSuite(int argc, char** argv) {
|
| +TestSuite::TestSuite(int argc, char** argv) : initialized_command_line_(false) {
|
| PreInitialize(argc, argv, true);
|
| }
|
|
|
| -TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager) {
|
| +TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager)
|
| + : initialized_command_line_(false) {
|
| PreInitialize(argc, argv, create_at_exit_manager);
|
| }
|
|
|
| TestSuite::~TestSuite() {
|
| - CommandLine::Reset();
|
| + if (initialized_command_line_)
|
| + CommandLine::Reset();
|
| }
|
|
|
| void TestSuite::PreInitialize(int argc, char** argv,
|
| @@ -89,7 +91,7 @@ void TestSuite::PreInitialize(int argc, char** argv,
|
| testing::GTEST_FLAG(catch_exceptions) = false;
|
| #endif
|
| base::EnableTerminationOnHeapCorruption();
|
| - CommandLine::Init(argc, argv);
|
| + initialized_command_line_ = CommandLine::Init(argc, argv);
|
| testing::InitGoogleTest(&argc, argv);
|
| #if defined(OS_LINUX) && defined(USE_AURA)
|
| // When calling native char conversion functions (e.g wrctomb) we need to
|
|
|