Chromium Code Reviews| 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::GetInstance()->SetEnabled( | |
| 28 base::debug::CategoryFilter("cc"), | |
| 29 base::debug::TraceLog::ECHO_TO_STDERR); | |
|
danakj
2013/04/24 20:07:41
Do you want RECORD_CONTINUOUSLY in the options as
Ian Vollick
2013/04/24 22:57:11
Good call! Done.
| |
| 30 } | |
| 31 | |
| 20 message_loop_.reset(new MessageLoop); | 32 message_loop_.reset(new MessageLoop); |
| 33 | |
| 34 base::ThreadIdNameManager::GetInstance()->SetName( | |
| 35 base::PlatformThread::CurrentId(), | |
| 36 "Main"); | |
| 21 } | 37 } |
| 22 | 38 |
| 23 void CCTestSuite::Shutdown() { | 39 void CCTestSuite::Shutdown() { |
| 24 message_loop_.reset(); | 40 message_loop_.reset(); |
| 25 | 41 |
| 26 base::TestSuite::Shutdown(); | 42 base::TestSuite::Shutdown(); |
| 27 } | 43 } |
| 28 | 44 |
| 29 } // namespace cc | 45 } // namespace cc |
| OLD | NEW |