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

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

Issue 165297: Replaces some TrimWhitespace with TrimWhitespaceASCII or TrimWhitespaceUTF8.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: hunspell fix Created 11 years, 4 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/browser/net/url_fixer_upper.cc ('k') | chrome/test/selenium/selenium_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
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 "chrome/test/chrome_process_util.h" 5 #include "chrome/test/chrome_process_util.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/process_util.h" 14 #include "base/process_util.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "chrome/common/chrome_constants.h" 16 #include "chrome/common/chrome_constants.h"
17 17
18 base::ProcessId ChromeBrowserProcessId(const FilePath& data_dir) { 18 base::ProcessId ChromeBrowserProcessId(const FilePath& data_dir) {
19 FilePath socket_name = data_dir.Append(chrome::kSingletonSocketFilename); 19 FilePath socket_name = data_dir.Append(chrome::kSingletonSocketFilename);
20 20
21 std::vector<std::string> argv; 21 std::vector<std::string> argv;
22 argv.push_back("fuser"); 22 argv.push_back("fuser");
23 argv.push_back(socket_name.value()); 23 argv.push_back(socket_name.value());
24 24
25 std::string fuser_output; 25 std::string fuser_output;
26 if (!base::GetAppOutput(CommandLine(argv), &fuser_output)) 26 if (!base::GetAppOutput(CommandLine(argv), &fuser_output))
27 return -1; 27 return -1;
28 28
29 std::string trimmed_output; 29 std::string trimmed_output;
30 TrimWhitespace(fuser_output, TRIM_ALL, &trimmed_output); 30 TrimWhitespaceASCII(fuser_output, TRIM_ALL, &trimmed_output);
31 31
32 if (trimmed_output.find(' ') != std::string::npos) { 32 if (trimmed_output.find(' ') != std::string::npos) {
33 LOG(FATAL) << "Expected exactly 1 process to have socket open: " << 33 LOG(FATAL) << "Expected exactly 1 process to have socket open: " <<
34 fuser_output; 34 fuser_output;
35 return -1; 35 return -1;
36 } 36 }
37 37
38 int pid; 38 int pid;
39 if (!StringToInt(trimmed_output, &pid)) { 39 if (!StringToInt(trimmed_output, &pid)) {
40 LOG(FATAL) << "Unexpected fuser output: " << fuser_output; 40 LOG(FATAL) << "Unexpected fuser output: " << fuser_output;
41 return -1; 41 return -1;
42 } 42 }
43 return pid; 43 return pid;
44 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/net/url_fixer_upper.cc ('k') | chrome/test/selenium/selenium_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698