| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 std::string data("hello"); | 1357 std::string data("hello"); |
| 1358 ASSERT_TRUE(file_util::WriteFile(bar, data.c_str(), data.length())); | 1358 ASSERT_TRUE(file_util::WriteFile(bar, data.c_str(), data.length())); |
| 1359 ASSERT_TRUE(file_util::WriteFile(baz, data.c_str(), data.length())); | 1359 ASSERT_TRUE(file_util::WriteFile(baz, data.c_str(), data.length())); |
| 1360 ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length())); | 1360 ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length())); |
| 1361 | 1361 |
| 1362 EXPECT_TRUE(file_util::ContainsPath(foo, bar)); | 1362 EXPECT_TRUE(file_util::ContainsPath(foo, bar)); |
| 1363 EXPECT_FALSE(file_util::ContainsPath(foo, baz)); | 1363 EXPECT_FALSE(file_util::ContainsPath(foo, baz)); |
| 1364 EXPECT_FALSE(file_util::ContainsPath(foo, foobar)); | 1364 EXPECT_FALSE(file_util::ContainsPath(foo, foobar)); |
| 1365 EXPECT_FALSE(file_util::ContainsPath(foo, foo)); | 1365 EXPECT_FALSE(file_util::ContainsPath(foo, foo)); |
| 1366 | 1366 |
| 1367 // Platform-specific concerns | 1367 // Platform-specific concerns. |
| 1368 FilePath foo_caps(data_dir.Append(FILE_PATH_LITERAL("FOO"))); | 1368 FilePath foo_caps(data_dir.Append(FILE_PATH_LITERAL("FOO"))); |
| 1369 #if defined(OS_WIN) | 1369 #if defined(OS_WIN) |
| 1370 EXPECT_TRUE(file_util::ContainsPath(foo, | 1370 EXPECT_TRUE(file_util::ContainsPath(foo, |
| 1371 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); | 1371 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); |
| 1372 EXPECT_TRUE(file_util::ContainsPath(foo, | 1372 EXPECT_TRUE(file_util::ContainsPath(foo, |
| 1373 FilePath(foo.value() + FILE_PATH_LITERAL("/bar.txt")))); | 1373 FilePath(foo.value() + FILE_PATH_LITERAL("/bar.txt")))); |
| 1374 #elif defined(OS_LINUX) | 1374 #elif defined(OS_MACOSX) |
| 1375 // We can't really do this test on OS X since the case-sensitivity of the |
| 1376 // filesystem is configurable. |
| 1377 #elif defined(OS_POSIX) |
| 1375 EXPECT_FALSE(file_util::ContainsPath(foo, | 1378 EXPECT_FALSE(file_util::ContainsPath(foo, |
| 1376 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); | 1379 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); |
| 1377 #else | |
| 1378 // We can't really do this test on osx since the case-sensitivity of the | |
| 1379 // filesystem is configurable. | |
| 1380 #endif | 1380 #endif |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 } // namespace | 1383 } // namespace |
| OLD | NEW |