Index: cc/test/cc_test_suite.cc |
diff --git a/cc/test/cc_test_suite.cc b/cc/test/cc_test_suite.cc |
index 19d478eb59ec0a55d213d30311ca5b5c6e4f9595..d4d15d3e42d423f87e21bc3251987ebadc4be959 100644 |
--- a/cc/test/cc_test_suite.cc |
+++ b/cc/test/cc_test_suite.cc |
@@ -4,7 +4,13 @@ |
#include "cc/test/cc_test_suite.h" |
+#include <string> |
+ |
+#include "base/command_line.h" |
+#include "base/debug/trace_event_impl.h" |
#include "base/message_loop.h" |
+#include "base/threading/thread_id_name_manager.h" |
+#include "cc/base/switches.h" |
#include "cc/test/paths.h" |
namespace cc { |
@@ -17,7 +23,26 @@ CCTestSuite::~CCTestSuite() {} |
void CCTestSuite::Initialize() { |
base::TestSuite::Initialize(); |
RegisterPathProvider(); |
+ |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kCCUnittestsTraceEventsToVLOG)) { |
+ std::string category_string = |
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ switches::kCCUnittestsTraceEventsToVLOG); |
+ |
+ if (!category_string.size()) |
+ category_string = "cc"; |
+ |
+ base::debug::TraceLog::GetInstance()->SetEnabled( |
+ base::debug::CategoryFilter(category_string), |
+ base::debug::TraceLog::ECHO_TO_VLOG); |
+ } |
+ |
message_loop_.reset(new base::MessageLoop); |
+ |
+ base::ThreadIdNameManager::GetInstance()->SetName( |
+ base::PlatformThread::CurrentId(), |
+ "Main"); |
} |
void CCTestSuite::Shutdown() { |