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

Side by Side Diff: base/test_suite.h

Issue 174264: linux: call g_thread_init() at relevant startup points (Closed)
Patch Set: retry Created 11 years, 4 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
« no previous file with comments | « base/process_util_unittest.cc ('k') | build/linux/system.gyp » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef BASE_TEST_SUITE_H_ 5 #ifndef BASE_TEST_SUITE_H_
6 #define BASE_TEST_SUITE_H_ 6 #define BASE_TEST_SUITE_H_
7 7
8 // Defines a basic test suite framework for running gtest based tests. You can 8 // Defines a basic test suite framework for running gtest based tests. You can
9 // instantiate this class in your main function and call its Run method to run 9 // instantiate this class in your main function and call its Run method to run
10 // any gtest based tests that are linked into your executable. 10 // any gtest based tests that are linked into your executable.
(...skipping 23 matching lines...) Expand all
34 #include <gtk/gtk.h> 34 #include <gtk/gtk.h>
35 #endif 35 #endif
36 36
37 class TestSuite { 37 class TestSuite {
38 public: 38 public:
39 TestSuite(int argc, char** argv) { 39 TestSuite(int argc, char** argv) {
40 base::EnableTerminationOnHeapCorruption(); 40 base::EnableTerminationOnHeapCorruption();
41 CommandLine::Init(argc, argv); 41 CommandLine::Init(argc, argv);
42 testing::InitGoogleTest(&argc, argv); 42 testing::InitGoogleTest(&argc, argv);
43 #if defined(OS_LINUX) 43 #if defined(OS_LINUX)
44 g_thread_init(NULL);
44 gtk_init_check(&argc, &argv); 45 gtk_init_check(&argc, &argv);
45 #endif 46 #endif
46 // Don't add additional code to this constructor. Instead add it to 47 // Don't add additional code to this constructor. Instead add it to
47 // Initialize(). See bug 6436. 48 // Initialize(). See bug 6436.
48 } 49 }
49 50
50 virtual ~TestSuite() { 51 virtual ~TestSuite() {
51 CommandLine::Terminate(); 52 CommandLine::Terminate();
52 } 53 }
53 54
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 149
149 virtual void Shutdown() { 150 virtual void Shutdown() {
150 } 151 }
151 152
152 // Make sure that we setup an AtExitManager so Singleton objects will be 153 // Make sure that we setup an AtExitManager so Singleton objects will be
153 // destroyed. 154 // destroyed.
154 base::AtExitManager at_exit_manager_; 155 base::AtExitManager at_exit_manager_;
155 }; 156 };
156 157
157 #endif // BASE_TEST_SUITE_H_ 158 #endif // BASE_TEST_SUITE_H_
OLDNEW
« no previous file with comments | « base/process_util_unittest.cc ('k') | build/linux/system.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698