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

Unified Diff: cc/test/cc_test_suite.cc

Issue 14474006: Add a command line flag for dumping trace events to VLOG (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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
Index: cc/test/cc_test_suite.cc
diff --git a/cc/test/cc_test_suite.cc b/cc/test/cc_test_suite.cc
index c9d48b7ee763eec975799c24298ffc99e5d56418..58b8d06b5119d611d5ef52577395e686e644fefb 100644
--- a/cc/test/cc_test_suite.cc
+++ b/cc/test/cc_test_suite.cc
@@ -4,7 +4,11 @@
#include "cc/test/cc_test_suite.h"
+#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 +21,24 @@ CCTestSuite::~CCTestSuite() {}
void CCTestSuite::Initialize() {
base::TestSuite::Initialize();
RegisterPathProvider();
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kCCUnittestsTraceEventsToStderr)) {
+ base::debug::TraceLog::Options options =
+ static_cast<base::debug::TraceLog::Options>(
+ base::debug::TraceLog::ECHO_TO_STDERR |
+ base::debug::TraceLog::RECORD_CONTINUOUSLY);
nduca 2013/04/25 02:32:35 not sure i get this bit. Why not turn on a non-rec
+
+ base::debug::TraceLog::GetInstance()->SetEnabled(
+ base::debug::CategoryFilter("cc"),
+ options);
+ }
+
message_loop_.reset(new MessageLoop);
+
+ base::ThreadIdNameManager::GetInstance()->SetName(
+ base::PlatformThread::CurrentId(),
+ "Main");
}
void CCTestSuite::Shutdown() {

Powered by Google App Engine
This is Rietveld 408576698