• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/process/launch.h"
6 
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10 
11 namespace base {
12 
TEST(LaunchWinTest,GetAppOutputWithExitCodeShouldReturnExitCode)13 TEST(LaunchWinTest, GetAppOutputWithExitCodeShouldReturnExitCode) {
14   CommandLine cl(FilePath(FILE_PATH_LITERAL("cmd")));
15   cl.AppendArg("/c");
16   cl.AppendArg("this-is-not-an-application");
17   std::string output;
18   int exit_code;
19   ASSERT_TRUE(GetAppOutputWithExitCode(cl, &output, &exit_code));
20   ASSERT_TRUE(output.empty());
21   ASSERT_EQ(1, exit_code);
22 }
23 
24 }  // namespace
25