Fix a type mismatch on Windows caused by r201738.
[chromium-blink-merge.git] / cc / test / cc_test_suite.cc
blobd4d15d3e42d423f87e21bc3251987ebadc4be959
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
3 // found in the LICENSE file.
5 #include "cc/test/cc_test_suite.h"
7 #include <string>
9 #include "base/command_line.h"
10 #include "base/debug/trace_event_impl.h"
11 #include "base/message_loop.h"
12 #include "base/threading/thread_id_name_manager.h"
13 #include "cc/base/switches.h"
14 #include "cc/test/paths.h"
16 namespace cc {
18 CCTestSuite::CCTestSuite(int argc, char** argv)
19 : base::TestSuite(argc, argv) {}
21 CCTestSuite::~CCTestSuite() {}
23 void CCTestSuite::Initialize() {
24 base::TestSuite::Initialize();
25 RegisterPathProvider();
27 if (CommandLine::ForCurrentProcess()->HasSwitch(
28 switches::kCCUnittestsTraceEventsToVLOG)) {
29 std::string category_string =
30 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
31 switches::kCCUnittestsTraceEventsToVLOG);
33 if (!category_string.size())
34 category_string = "cc";
36 base::debug::TraceLog::GetInstance()->SetEnabled(
37 base::debug::CategoryFilter(category_string),
38 base::debug::TraceLog::ECHO_TO_VLOG);
41 message_loop_.reset(new base::MessageLoop);
43 base::ThreadIdNameManager::GetInstance()->SetName(
44 base::PlatformThread::CurrentId(),
45 "Main");
48 void CCTestSuite::Shutdown() {
49 message_loop_.reset();
51 base::TestSuite::Shutdown();
54 } // namespace cc