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

Side by Side Diff: base/process_util_unittest.cc

Issue 7377012: Change base::LaunchProcess API slightly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « base/process_util_posix.cc ('k') | base/process_util_win.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 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 args.push_back("echo $BASE_TEST"); 504 args.push_back("echo $BASE_TEST");
505 505
506 int fds[2]; 506 int fds[2];
507 PCHECK(pipe(fds) == 0); 507 PCHECK(pipe(fds) == 0);
508 508
509 fds_to_remap.push_back(std::make_pair(fds[1], 1)); 509 fds_to_remap.push_back(std::make_pair(fds[1], 1));
510 base::LaunchOptions options; 510 base::LaunchOptions options;
511 options.wait = true; 511 options.wait = true;
512 options.environ = &env_changes; 512 options.environ = &env_changes;
513 options.fds_to_remap = &fds_to_remap; 513 options.fds_to_remap = &fds_to_remap;
514 EXPECT_TRUE(base::LaunchProcess(args, options)); 514 EXPECT_TRUE(base::LaunchProcess(args, options, NULL));
515 PCHECK(HANDLE_EINTR(close(fds[1])) == 0); 515 PCHECK(HANDLE_EINTR(close(fds[1])) == 0);
516 516
517 char buf[512]; 517 char buf[512];
518 const ssize_t n = HANDLE_EINTR(read(fds[0], buf, sizeof(buf))); 518 const ssize_t n = HANDLE_EINTR(read(fds[0], buf, sizeof(buf)));
519 PCHECK(n > 0); 519 PCHECK(n > 0);
520 520
521 PCHECK(HANDLE_EINTR(close(fds[0])) == 0); 521 PCHECK(HANDLE_EINTR(close(fds[0])) == 0);
522 522
523 return std::string(buf, n); 523 return std::string(buf, n);
524 } 524 }
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 ASSERT_DEATH({ 985 ASSERT_DEATH({
986 SetUpInDeathAssert(); 986 SetUpInDeathAssert();
987 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} 987 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {}
988 }, ""); 988 }, "");
989 } 989 }
990 990
991 #endif // !ARCH_CPU_64_BITS 991 #endif // !ARCH_CPU_64_BITS
992 #endif // OS_MACOSX 992 #endif // OS_MACOSX
993 993
994 #endif // !defined(OS_WIN) 994 #endif // !defined(OS_WIN)
OLDNEW
« no previous file with comments | « base/process_util_posix.cc ('k') | base/process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698