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

Side by Side 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, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/base/switches.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/cc_test_suite.h" 5 #include "cc/test/cc_test_suite.h"
6 6
7 #include <string>
8
9 #include "base/command_line.h"
10 #include "base/debug/trace_event_impl.h"
7 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/threading/thread_id_name_manager.h"
13 #include "cc/base/switches.h"
8 #include "cc/test/paths.h" 14 #include "cc/test/paths.h"
9 15
10 namespace cc { 16 namespace cc {
11 17
12 CCTestSuite::CCTestSuite(int argc, char** argv) 18 CCTestSuite::CCTestSuite(int argc, char** argv)
13 : base::TestSuite(argc, argv) {} 19 : base::TestSuite(argc, argv) {}
14 20
15 CCTestSuite::~CCTestSuite() {} 21 CCTestSuite::~CCTestSuite() {}
16 22
17 void CCTestSuite::Initialize() { 23 void CCTestSuite::Initialize() {
18 base::TestSuite::Initialize(); 24 base::TestSuite::Initialize();
19 RegisterPathProvider(); 25 RegisterPathProvider();
26
27 if (CommandLine::ForCurrentProcess()->HasSwitch(
28 switches::kCCUnittestsTraceEventsToVLOG)) {
29 std::string category_string =
30 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
31 switches::kCCUnittestsTraceEventsToVLOG);
32
33 if (!category_string.size())
34 category_string = "cc";
35
36 base::debug::TraceLog::GetInstance()->SetEnabled(
37 base::debug::CategoryFilter(category_string),
38 base::debug::TraceLog::ECHO_TO_VLOG);
39 }
40
20 message_loop_.reset(new base::MessageLoop); 41 message_loop_.reset(new base::MessageLoop);
42
43 base::ThreadIdNameManager::GetInstance()->SetName(
44 base::PlatformThread::CurrentId(),
45 "Main");
21 } 46 }
22 47
23 void CCTestSuite::Shutdown() { 48 void CCTestSuite::Shutdown() {
24 message_loop_.reset(); 49 message_loop_.reset();
25 50
26 base::TestSuite::Shutdown(); 51 base::TestSuite::Shutdown();
27 } 52 }
28 53
29 } // namespace cc 54 } // namespace cc
OLDNEW
« 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