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 "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 pre_test_name, | 79 pre_test_name, |
80 command_line, | 80 command_line, |
81 default_timeout, | 81 default_timeout, |
82 was_timeout); | 82 was_timeout); |
83 if (exit_code != 0) | 83 if (exit_code != 0) |
84 return exit_code; | 84 return exit_code; |
85 } | 85 } |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 CommandLine new_cmd_line(command_line); | 89 CommandLine new_cmd_line(command_line.GetProgram()); |
90 CommandLine::SwitchMap switches = command_line.GetSwitches(); | |
91 | |
92 // Strip out gtest_output flag because otherwise we would overwrite results | |
93 // of the other tests. | |
94 switches.erase(base::kGTestOutputFlag); | |
95 | |
96 for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); | |
97 iter != switches.end(); ++iter) { | |
98 new_cmd_line.AppendSwitchNative((*iter).first, (*iter).second); | |
M-A Ruel
2013/08/15 01:59:14
same interogation
Paweł Hajdan Jr.
2013/08/15 21:54:45
Done.
| |
99 } | |
90 | 100 |
91 // Always enable disabled tests. This method is not called with disabled | 101 // Always enable disabled tests. This method is not called with disabled |
92 // tests unless this flag was specified to the browser test executable. | 102 // tests unless this flag was specified to the browser test executable. |
93 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); | 103 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); |
94 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); | 104 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); |
95 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); | 105 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); |
96 | 106 |
97 char* browser_wrapper = getenv("BROWSER_WRAPPER"); | 107 char* browser_wrapper = getenv("BROWSER_WRAPPER"); |
98 int exit_code = base::LaunchChildGTestProcess( | 108 int exit_code = base::LaunchChildGTestProcess( |
99 new_cmd_line, | 109 new_cmd_line, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 | 352 |
343 WrapperTestLauncherDelegate delegate(launcher_delegate); | 353 WrapperTestLauncherDelegate delegate(launcher_delegate); |
344 return base::LaunchTests(&delegate, argc, argv); | 354 return base::LaunchTests(&delegate, argc, argv); |
345 } | 355 } |
346 | 356 |
347 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 357 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
348 return g_launcher_delegate; | 358 return g_launcher_delegate; |
349 } | 359 } |
350 | 360 |
351 } // namespace content | 361 } // namespace content |
OLD | NEW |