blob: 1b060c55822cc8219beea292554a9eab7d01eac8 [file] [log] [blame]
Andrew Top0d1858f2019-05-15 22:01:47 -07001// Copyright 2017 The Chromium Authors. All rights reserved.
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
11namespace base {
12
13TEST(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