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

Side by Side Diff: chrome/test/test_launcher/out_of_proc_test_runner.cc

Issue 355014: Making the interactive ui tests run out of process (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/interactive_ui/interactive_ui_tests.gypi ('k') | no next file » | 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) 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 10
(...skipping 15 matching lines...) Expand all
26 virtual ~OutOfProcTestRunner() { 26 virtual ~OutOfProcTestRunner() {
27 } 27 }
28 28
29 bool Init() { 29 bool Init() {
30 return true; 30 return true;
31 } 31 }
32 32
33 // Returns true if the test succeeded, false if it failed. 33 // Returns true if the test succeeded, false if it failed.
34 bool RunTest(const std::string& test_name) { 34 bool RunTest(const std::string& test_name) {
35 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 35 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
36 #if defined(OS_WIN)
37 CommandLine new_cmd_line =
38 CommandLine::FromString(cmd_line->command_line_string());
39 #else
36 CommandLine new_cmd_line(cmd_line->argv()); 40 CommandLine new_cmd_line(cmd_line->argv());
41 #endif
37 // Always enable disabled tests. This method is not called with disabled 42 // Always enable disabled tests. This method is not called with disabled
38 // tests unless this flag was specified to the browser test executable. 43 // tests unless this flag was specified to the browser test executable.
39 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); 44 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests");
40 new_cmd_line.AppendSwitchWithValue("gtest_filter", test_name); 45 new_cmd_line.AppendSwitchWithValue("gtest_filter", test_name);
41 new_cmd_line.AppendSwitch(kChildProcessFlag); 46 new_cmd_line.AppendSwitch(kChildProcessFlag);
42 47
43 base::ProcessHandle process_handle; 48 base::ProcessHandle process_handle;
44 bool r = base::LaunchApp(new_cmd_line, false, false, &process_handle); 49 bool r = base::LaunchApp(new_cmd_line, false, false, &process_handle);
45 if (!r) 50 if (!r)
46 return false; 51 return false;
(...skipping 30 matching lines...) Expand all
77 82
78 if (command_line->HasSwitch(kChildProcessFlag)) 83 if (command_line->HasSwitch(kChildProcessFlag))
79 return ChromeTestSuite(argc, argv).Run(); 84 return ChromeTestSuite(argc, argv).Run();
80 85
81 if (command_line->HasSwitch(kGTestListTestsFlag)) 86 if (command_line->HasSwitch(kGTestListTestsFlag))
82 return ChromeTestSuite(argc, argv).Run(); 87 return ChromeTestSuite(argc, argv).Run();
83 88
84 OutOfProcTestRunnerFactory test_runner_factory; 89 OutOfProcTestRunnerFactory test_runner_factory;
85 return tests::RunTests(test_runner_factory) ? 0 : 1; 90 return tests::RunTests(test_runner_factory) ? 0 : 1;
86 } 91 }
OLDNEW
« no previous file with comments | « chrome/test/interactive_ui/interactive_ui_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698