OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug_on_start.h" | 11 #include "base/debug_on_start.h" |
12 #include "base/debug_util.h" | 12 #include "base/debug_util.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/i18n/icu_util.h" | 14 #include "base/i18n/icu_util.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/mac/scoped_nsautorelease_pool.h" |
16 #include "base/nss_util.h" | 17 #include "base/nss_util.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "base/process_util.h" | 19 #include "base/process_util.h" |
19 #include "base/scoped_nsautorelease_pool.h" | |
20 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
21 #include "base/test/multiprocess_test.h" | 21 #include "base/test/multiprocess_test.h" |
22 #include "base/test/test_timeouts.h" | 22 #include "base/test/test_timeouts.h" |
23 #include "base/time.h" | 23 #include "base/time.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "testing/multiprocess_func_list.h" | 25 #include "testing/multiprocess_func_list.h" |
26 | 26 |
27 #if defined(TOOLKIT_USES_GTK) | 27 #if defined(TOOLKIT_USES_GTK) |
28 #include <gtk/gtk.h> | 28 #include <gtk/gtk.h> |
29 #endif | 29 #endif |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 void TestSuite::CatchMaybeTests() { | 107 void TestSuite::CatchMaybeTests() { |
108 testing::TestEventListeners& listeners = | 108 testing::TestEventListeners& listeners = |
109 testing::UnitTest::GetInstance()->listeners(); | 109 testing::UnitTest::GetInstance()->listeners(); |
110 listeners.Append(new MaybeTestDisabler); | 110 listeners.Append(new MaybeTestDisabler); |
111 } | 111 } |
112 | 112 |
113 // Don't add additional code to this method. Instead add it to | 113 // Don't add additional code to this method. Instead add it to |
114 // Initialize(). See bug 6436. | 114 // Initialize(). See bug 6436. |
115 int TestSuite::Run() { | 115 int TestSuite::Run() { |
116 base::ScopedNSAutoreleasePool scoped_pool; | 116 base::mac::ScopedNSAutoreleasePool scoped_pool; |
117 | 117 |
118 Initialize(); | 118 Initialize(); |
119 std::string client_func = | 119 std::string client_func = |
120 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 120 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
121 switches::kTestChildProcess); | 121 switches::kTestChildProcess); |
122 // Check to see if we are being run as a client process. | 122 // Check to see if we are being run as a client process. |
123 if (!client_func.empty()) | 123 if (!client_func.empty()) |
124 return multi_process_function_list::InvokeChildProcessTest(client_func); | 124 return multi_process_function_list::InvokeChildProcessTest(client_func); |
125 int result = RUN_ALL_TESTS(); | 125 int result = RUN_ALL_TESTS(); |
126 | 126 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 base::EnsureNSSInit(); | 208 base::EnsureNSSInit(); |
209 #endif // defined(USE_NSS) | 209 #endif // defined(USE_NSS) |
210 | 210 |
211 CatchMaybeTests(); | 211 CatchMaybeTests(); |
212 | 212 |
213 TestTimeouts::Initialize(); | 213 TestTimeouts::Initialize(); |
214 } | 214 } |
215 | 215 |
216 void TestSuite::Shutdown() { | 216 void TestSuite::Shutdown() { |
217 } | 217 } |
OLD | NEW |