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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 #if defined(OS_WIN) | 216 #if defined(OS_WIN) |
217 // This function is deprecated, but still used on Windows. | 217 // This function is deprecated, but still used on Windows. |
218 TEST_F(FileUtilTest, AppendToPath) { | 218 TEST_F(FileUtilTest, AppendToPath) { |
219 for (unsigned int i = 0; i < arraysize(append_cases); ++i) { | 219 for (unsigned int i = 0; i < arraysize(append_cases); ++i) { |
220 const append_case& value = append_cases[i]; | 220 const append_case& value = append_cases[i]; |
221 std::wstring result = value.path; | 221 std::wstring result = value.path; |
222 file_util::AppendToPath(&result, value.ending); | 222 file_util::AppendToPath(&result, value.ending); |
223 EXPECT_EQ(value.result, result); | 223 EXPECT_EQ(value.result, result); |
224 } | 224 } |
225 | 225 |
226 #ifdef NDEBUG | 226 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
227 file_util::AppendToPath(NULL, L"path"); // asserts in debug mode | 227 file_util::AppendToPath(NULL, L"path"); // asserts in debug mode |
228 #endif | 228 #endif |
229 } | 229 } |
230 #endif // defined(OS_WIN) | 230 #endif // defined(OS_WIN) |
231 | 231 |
232 static const struct filename_case { | 232 static const struct filename_case { |
233 const wchar_t* path; | 233 const wchar_t* path; |
234 const wchar_t* filename; | 234 const wchar_t* filename; |
235 } filename_cases[] = { | 235 } filename_cases[] = { |
236 #if defined(OS_WIN) | 236 #if defined(OS_WIN) |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); | 1807 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); |
1808 | 1808 |
1809 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); | 1809 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); |
1810 std::string bar("baz"); | 1810 std::string bar("baz"); |
1811 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); | 1811 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); |
1812 | 1812 |
1813 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); | 1813 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); |
1814 } | 1814 } |
1815 | 1815 |
1816 } // namespace | 1816 } // namespace |
OLD | NEW |