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 "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/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
13 #include "base/debug/stack_trace.h" | 13 #include "base/debug/stack_trace.h" |
14 #include "base/feature_list.h" | |
15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
16 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
17 #include "base/i18n/icu_util.h" | 16 #include "base/i18n/icu_util.h" |
18 #include "base/logging.h" | 17 #include "base/logging.h" |
19 #include "base/macros.h" | 18 #include "base/macros.h" |
20 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
21 #include "base/path_service.h" | 20 #include "base/path_service.h" |
22 #include "base/process/launch.h" | 21 #include "base/process/launch.h" |
23 #include "base/process/memory.h" | 22 #include "base/process/memory.h" |
24 #include "base/test/gtest_xml_unittest_result_printer.h" | 23 #include "base/test/gtest_xml_unittest_result_printer.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 216 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
218 switches::kTestChildProcess); | 217 switches::kTestChildProcess); |
219 | 218 |
220 // Check to see if we are being run as a client process. | 219 // Check to see if we are being run as a client process. |
221 if (!client_func.empty()) | 220 if (!client_func.empty()) |
222 return multi_process_function_list::InvokeChildProcessTest(client_func); | 221 return multi_process_function_list::InvokeChildProcessTest(client_func); |
223 #if defined(OS_IOS) | 222 #if defined(OS_IOS) |
224 test_listener_ios::RegisterTestEndListener(); | 223 test_listener_ios::RegisterTestEndListener(); |
225 #endif | 224 #endif |
226 | 225 |
227 // Set up a FeatureList instance, so that code using that API will not hit a | |
228 // an error that it's not set. Cleared by ClearInstanceForTesting() below. | |
229 base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList)); | |
Igor Sheludko
2016/03/29 21:18:20
At this moment gin::IsolateHolder (and therefore F
| |
230 | |
231 int result = RUN_ALL_TESTS(); | 226 int result = RUN_ALL_TESTS(); |
232 | 227 |
233 // Clear the FeatureList that was registered above. | |
234 FeatureList::ClearInstanceForTesting(); | |
235 | |
236 #if defined(OS_MACOSX) | 228 #if defined(OS_MACOSX) |
237 // This MUST happen before Shutdown() since Shutdown() tears down | 229 // This MUST happen before Shutdown() since Shutdown() tears down |
238 // objects (such as NotificationService::current()) that Cocoa | 230 // objects (such as NotificationService::current()) that Cocoa |
239 // objects use to remove themselves as observers. | 231 // objects use to remove themselves as observers. |
240 scoped_pool.Recycle(); | 232 scoped_pool.Recycle(); |
241 #endif | 233 #endif |
242 | 234 |
243 Shutdown(); | 235 Shutdown(); |
244 | 236 |
245 return result; | 237 return result; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 | 350 |
359 TestTimeouts::Initialize(); | 351 TestTimeouts::Initialize(); |
360 | 352 |
361 trace_to_file_.BeginTracingFromCommandLineOptions(); | 353 trace_to_file_.BeginTracingFromCommandLineOptions(); |
362 } | 354 } |
363 | 355 |
364 void TestSuite::Shutdown() { | 356 void TestSuite::Shutdown() { |
365 } | 357 } |
366 | 358 |
367 } // namespace base | 359 } // namespace base |
OLD | NEW |