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

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: rebase 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
« no previous file with comments | « cc/base/switches.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « cc/base/switches.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698