OLD | NEW |
---|---|
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 "base/command_line.h" | |
8 #include "base/debug/trace_event_impl.h" | |
7 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/threading/thread_id_name_manager.h" | |
11 #include "cc/base/switches.h" | |
8 #include "cc/test/paths.h" | 12 #include "cc/test/paths.h" |
9 | 13 |
10 namespace cc { | 14 namespace cc { |
11 | 15 |
12 CCTestSuite::CCTestSuite(int argc, char** argv) | 16 CCTestSuite::CCTestSuite(int argc, char** argv) |
13 : base::TestSuite(argc, argv) {} | 17 : base::TestSuite(argc, argv) {} |
14 | 18 |
15 CCTestSuite::~CCTestSuite() {} | 19 CCTestSuite::~CCTestSuite() {} |
16 | 20 |
17 void CCTestSuite::Initialize() { | 21 void CCTestSuite::Initialize() { |
18 base::TestSuite::Initialize(); | 22 base::TestSuite::Initialize(); |
19 RegisterPathProvider(); | 23 RegisterPathProvider(); |
24 | |
25 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
26 switches::kCCUnittestsTraceEventsToStderr)) { | |
27 base::debug::TraceLog::Options options = | |
28 static_cast<base::debug::TraceLog::Options>( | |
29 base::debug::TraceLog::ECHO_TO_STDERR | | |
30 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
| |
31 | |
32 base::debug::TraceLog::GetInstance()->SetEnabled( | |
33 base::debug::CategoryFilter("cc"), | |
34 options); | |
35 } | |
36 | |
20 message_loop_.reset(new MessageLoop); | 37 message_loop_.reset(new MessageLoop); |
38 | |
39 base::ThreadIdNameManager::GetInstance()->SetName( | |
40 base::PlatformThread::CurrentId(), | |
41 "Main"); | |
21 } | 42 } |
22 | 43 |
23 void CCTestSuite::Shutdown() { | 44 void CCTestSuite::Shutdown() { |
24 message_loop_.reset(); | 45 message_loop_.reset(); |
25 | 46 |
26 base::TestSuite::Shutdown(); | 47 base::TestSuite::Shutdown(); |
27 } | 48 } |
28 | 49 |
29 } // namespace cc | 50 } // namespace cc |
OLD | NEW |