Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2169)

Unified Diff: base/test/test_suite.cc

Issue 9477001: Allow callers of CommandLine::Init to know whether they were the first caller. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comment clarification. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_suite.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/test/test_suite.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698