OLD | NEW |
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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 other_cmd_line.AppendArg("import sys; sys.stderr.write('Hello!');"); | 382 other_cmd_line.AppendArg("import sys; sys.stderr.write('Hello!');"); |
383 output.clear(); | 383 output.clear(); |
384 ASSERT_TRUE(base::GetAppOutput(other_cmd_line, &output)); | 384 ASSERT_TRUE(base::GetAppOutput(other_cmd_line, &output)); |
385 EXPECT_EQ("", output); | 385 EXPECT_EQ("", output); |
386 } | 386 } |
387 | 387 |
388 TEST_F(ProcessUtilTest, LaunchAsUser) { | 388 TEST_F(ProcessUtilTest, LaunchAsUser) { |
389 base::UserTokenHandle token; | 389 base::UserTokenHandle token; |
390 ASSERT_TRUE(OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &token)); | 390 ASSERT_TRUE(OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &token)); |
391 std::wstring cmdline = | 391 std::wstring cmdline = |
392 this->MakeCmdLine("SimpleChildProcess", false).command_line_string(); | 392 this->MakeCmdLine("SimpleChildProcess", false).GetCommandLineString(); |
393 base::LaunchOptions options; | 393 base::LaunchOptions options; |
394 options.as_user = token; | 394 options.as_user = token; |
395 EXPECT_TRUE(base::LaunchProcess(cmdline, options, NULL)); | 395 EXPECT_TRUE(base::LaunchProcess(cmdline, options, NULL)); |
396 } | 396 } |
397 | 397 |
398 #endif // defined(OS_WIN) | 398 #endif // defined(OS_WIN) |
399 | 399 |
400 #if defined(OS_POSIX) | 400 #if defined(OS_POSIX) |
401 | 401 |
402 namespace { | 402 namespace { |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 ASSERT_DEATH({ | 1001 ASSERT_DEATH({ |
1002 SetUpInDeathAssert(); | 1002 SetUpInDeathAssert(); |
1003 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} | 1003 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} |
1004 }, ""); | 1004 }, ""); |
1005 } | 1005 } |
1006 | 1006 |
1007 #endif // !ARCH_CPU_64_BITS | 1007 #endif // !ARCH_CPU_64_BITS |
1008 #endif // OS_MACOSX | 1008 #endif // OS_MACOSX |
1009 | 1009 |
1010 #endif // !defined(OS_WIN) | 1010 #endif // !defined(OS_WIN) |
OLD | NEW |