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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "base/win/scoped_handle.h" | 7 #include "base/win/scoped_handle.h" |
8 #include "sandbox/src/win_utils.h" | 8 #include "sandbox/win/src/win_utils.h" |
9 #include "sandbox/tests/common/test_utils.h" | 9 #include "sandbox/win/tests/common/test_utils.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 TEST(WinUtils, IsReparsePoint) { | 12 TEST(WinUtils, IsReparsePoint) { |
13 using sandbox::IsReparsePoint; | 13 using sandbox::IsReparsePoint; |
14 | 14 |
15 // Create a temp file because we need write access to it. | 15 // Create a temp file because we need write access to it. |
16 wchar_t temp_directory[MAX_PATH]; | 16 wchar_t temp_directory[MAX_PATH]; |
17 wchar_t my_folder[MAX_PATH]; | 17 wchar_t my_folder[MAX_PATH]; |
18 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u); | 18 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u); |
19 ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, my_folder), 0u); | 19 ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, my_folder), 0u); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 EXPECT_TRUE(file.IsValid()); | 74 EXPECT_TRUE(file.IsValid()); |
75 std::wstring file_name_nt1 = std::wstring(L"\\??\\") + file_name; | 75 std::wstring file_name_nt1 = std::wstring(L"\\??\\") + file_name; |
76 std::wstring file_name_nt2 = std::wstring(L"\\??\\") + folder + L"\\FOO.txT"; | 76 std::wstring file_name_nt2 = std::wstring(L"\\??\\") + folder + L"\\FOO.txT"; |
77 EXPECT_TRUE(SameObject(file.Get(), file_name_nt1.c_str())); | 77 EXPECT_TRUE(SameObject(file.Get(), file_name_nt1.c_str())); |
78 EXPECT_TRUE(SameObject(file.Get(), file_name_nt2.c_str())); | 78 EXPECT_TRUE(SameObject(file.Get(), file_name_nt2.c_str())); |
79 | 79 |
80 file.Close(); | 80 file.Close(); |
81 EXPECT_TRUE(::RemoveDirectory(my_folder)); | 81 EXPECT_TRUE(::RemoveDirectory(my_folder)); |
82 } | 82 } |
OLD | NEW |