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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 EXPECT_TRUE(GetPythonCommand(&cmd_line)); | 54 EXPECT_TRUE(GetPythonCommand(&cmd_line)); |
55 | 55 |
56 // Run a python command to print a string and make sure the output is what | 56 // Run a python command to print a string and make sure the output is what |
57 // we want. | 57 // we want. |
58 cmd_line.AppendArg("-c"); | 58 cmd_line.AppendArg("-c"); |
59 std::string input("PythonUtilsTest"); | 59 std::string input("PythonUtilsTest"); |
60 std::string python_cmd = base::StringPrintf("print '%s';", input.c_str()); | 60 std::string python_cmd = base::StringPrintf("print '%s';", input.c_str()); |
61 cmd_line.AppendArg(python_cmd); | 61 cmd_line.AppendArg(python_cmd); |
62 std::string output; | 62 std::string output; |
63 EXPECT_TRUE(base::GetAppOutput(cmd_line, &output)); | 63 EXPECT_TRUE(base::GetAppOutput(cmd_line, &output)); |
64 base::TrimWhitespace(output, base::TRIM_TRAILING, &output); | 64 base::TrimWhitespaceASCII(output, base::TRIM_TRAILING, &output); |
65 EXPECT_EQ(input, output); | 65 EXPECT_EQ(input, output); |
66 } | 66 } |
OLD | NEW |