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

Side by Side Diff: chrome/test/layout_test_http_server.cc

Issue 7351003: Clean up users of a deprecated base::LaunchApp API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-only Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/service/service_child_process_host.cc ('k') | chrome/test/live_sync/live_sync_test.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/test/layout_test_http_server.h" 5 #include "chrome/test/layout_test_http_server.h"
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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 layout_tests_dir.value()); 75 layout_tests_dir.value());
76 76
77 // For Windows 7, if we start the lighttpd server on the foreground mode, 77 // For Windows 7, if we start the lighttpd server on the foreground mode,
78 // it will mess up with the command window and cause conhost.exe to crash. To 78 // it will mess up with the command window and cause conhost.exe to crash. To
79 // work around this, we start the http server on the background mode. 79 // work around this, we start the http server on the background mode.
80 #if defined(OS_WIN) 80 #if defined(OS_WIN)
81 if (base::win::GetVersion() >= base::win::VERSION_WIN7) 81 if (base::win::GetVersion() >= base::win::VERSION_WIN7)
82 cmd_line.AppendArg("--run_background"); 82 cmd_line.AppendArg("--run_background");
83 #endif 83 #endif
84 84
85 running_ = base::LaunchApp(cmd_line, true, false, NULL); 85 // The Python script waits for the server to start responding to requests,
86 // then exits. So we want to wait for the Python script to exit before
87 // continuing.
88 base::LaunchOptions options;
89 options.wait = true;
90 running_ = base::LaunchProcess(cmd_line, options);
86 return running_; 91 return running_;
87 } 92 }
88 93
89 bool LayoutTestHttpServer::Stop() { 94 bool LayoutTestHttpServer::Stop() {
90 if (!running_) { 95 if (!running_) {
91 LOG(ERROR) << "LayoutTestHttpServer not running."; 96 LOG(ERROR) << "LayoutTestHttpServer not running.";
92 return false; 97 return false;
93 } 98 }
94 99
95 CommandLine cmd_line(CommandLine::NO_PROGRAM); 100 CommandLine cmd_line(CommandLine::NO_PROGRAM);
96 if (!PrepareCommandLine(&cmd_line)) 101 if (!PrepareCommandLine(&cmd_line))
97 return false; 102 return false;
98 cmd_line.AppendArg("--server=stop"); 103 cmd_line.AppendArg("--server=stop");
99 bool stopped = base::LaunchApp(cmd_line, true, false, NULL); 104
105 base::LaunchOptions options;
106 options.wait = true;
107 bool stopped = base::LaunchProcess(cmd_line, options);
100 running_ = !stopped; 108 running_ = !stopped;
101 return stopped; 109 return stopped;
102 } 110 }
103 111
OLDNEW
« no previous file with comments | « chrome/service/service_child_process_host.cc ('k') | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698