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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 other_cmd_line.AppendArg("import sys; sys.stderr.write('Hello!');"); | 380 other_cmd_line.AppendArg("import sys; sys.stderr.write('Hello!');"); |
381 output.clear(); | 381 output.clear(); |
382 ASSERT_TRUE(base::GetAppOutput(other_cmd_line, &output)); | 382 ASSERT_TRUE(base::GetAppOutput(other_cmd_line, &output)); |
383 EXPECT_EQ("", output); | 383 EXPECT_EQ("", output); |
384 } | 384 } |
385 | 385 |
386 TEST_F(ProcessUtilTest, LaunchAsUser) { | 386 TEST_F(ProcessUtilTest, LaunchAsUser) { |
387 base::UserTokenHandle token; | 387 base::UserTokenHandle token; |
388 ASSERT_TRUE(OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &token)); | 388 ASSERT_TRUE(OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &token)); |
389 std::wstring cmdline = | 389 std::wstring cmdline = |
390 this->MakeCmdLine("SimpleChildProcess", false).command_line_string(); | 390 this->MakeCmdLine("SimpleChildProcess", false).GetCommandLineString(); |
391 EXPECT_TRUE(base::LaunchAppAsUser(token, cmdline, false, NULL)); | 391 EXPECT_TRUE(base::LaunchAppAsUser(token, cmdline, false, NULL)); |
392 } | 392 } |
393 | 393 |
394 #endif // defined(OS_WIN) | 394 #endif // defined(OS_WIN) |
395 | 395 |
396 #if defined(OS_POSIX) | 396 #if defined(OS_POSIX) |
397 | 397 |
398 namespace { | 398 namespace { |
399 | 399 |
400 // Returns the maximum number of files that a process can have open. | 400 // Returns the maximum number of files that a process can have open. |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) |
OLD | NEW |