OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
| 10 #include "base/win/win_util.h" |
10 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
11 #include "sandbox/win/tests/common/controller.h" | 12 #include "sandbox/win/tests/common/controller.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 | 14 |
14 namespace sandbox { | 15 namespace sandbox { |
15 | 16 |
16 SBOX_TESTS_COMMAND int HandleInheritanceTests_PrintToStdout(int argc, | 17 SBOX_TESTS_COMMAND int HandleInheritanceTests_PrintToStdout(int argc, |
17 wchar_t** argv) { | 18 wchar_t** argv) { |
18 printf("Example output to stdout\n"); | 19 printf("Example output to stdout\n"); |
19 return SBOX_TEST_SUCCEEDED; | 20 return SBOX_TEST_SUCCEEDED; |
(...skipping 23 matching lines...) Expand all Loading... |
43 ASSERT_TRUE(base::ReadFileToString(base::FilePath(temp_file_name), &data)); | 44 ASSERT_TRUE(base::ReadFileToString(base::FilePath(temp_file_name), &data)); |
44 // Redirection uses a feature that was added in Windows Vista. | 45 // Redirection uses a feature that was added in Windows Vista. |
45 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { | 46 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
46 ASSERT_EQ("Example output to stdout\r\n", data); | 47 ASSERT_EQ("Example output to stdout\r\n", data); |
47 } else { | 48 } else { |
48 ASSERT_EQ("", data); | 49 ASSERT_EQ("", data); |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 } // namespace sandbox | 53 } // namespace sandbox |
OLD | NEW |