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 "chrome/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/file_util.h" | |
11 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 // Test the behavior of chrome::GetUserCacheDirectory. | 16 // Test the behavior of chrome::GetUserCacheDirectory. |
17 // See that function's comments for discussion of the subtleties. | 17 // See that function's comments for discussion of the subtleties. |
18 TEST(ChromePaths, UserCacheDir) { | 18 TEST(ChromePaths, UserCacheDir) { |
19 base::FilePath test_profile_dir, cache_dir; | 19 base::FilePath test_profile_dir, cache_dir; |
20 #if defined(OS_MACOSX) | 20 #if defined(OS_MACOSX) |
21 ASSERT_TRUE(PathService::Get(base::DIR_APP_DATA, &test_profile_dir)); | 21 ASSERT_TRUE(PathService::Get(base::DIR_APP_DATA, &test_profile_dir)); |
(...skipping 26 matching lines...) Expand all Loading... |
48 // Verify that a profile in some other random directory doesn't use | 48 // Verify that a profile in some other random directory doesn't use |
49 // the special cache dir. | 49 // the special cache dir. |
50 test_profile_dir = base::FilePath(FILE_PATH_LITERAL("/some/other/path")); | 50 test_profile_dir = base::FilePath(FILE_PATH_LITERAL("/some/other/path")); |
51 chrome::GetUserCacheDirectory(test_profile_dir, &cache_dir); | 51 chrome::GetUserCacheDirectory(test_profile_dir, &cache_dir); |
52 #if defined(OS_ANDROID) | 52 #if defined(OS_ANDROID) |
53 EXPECT_EQ(expected_cache_dir.value(), cache_dir.value()); | 53 EXPECT_EQ(expected_cache_dir.value(), cache_dir.value()); |
54 #else | 54 #else |
55 EXPECT_EQ(test_profile_dir.value(), cache_dir.value()); | 55 EXPECT_EQ(test_profile_dir.value(), cache_dir.value()); |
56 #endif | 56 #endif |
57 } | 57 } |
OLD | NEW |