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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "testing/gtest/include/gtest/gtest-spi.h" | 13 #include "testing/gtest/include/gtest/gtest-spi.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
16 | 16 |
17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
18 #include <userenv.h> | 18 #include <userenv.h> |
19 #include "base/win/windows_version.h" | 19 #include "base/win/windows_version.h" |
20 // userenv.dll is required for GetDefaultUserProfileDirectory(). | 20 // userenv.dll is required for GetDefaultUserProfileDirectory(). |
21 #pragma comment(lib, "userenv.lib") | 21 #pragma comment(lib, "userenv.lib") |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 207 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
208 EXPECT_TRUE(PathService::Override(base::DIR_TEMP, temp_dir.path())); | 208 EXPECT_TRUE(PathService::Override(base::DIR_TEMP, temp_dir.path())); |
209 base::FilePath new_user_data_dir; | 209 base::FilePath new_user_data_dir; |
210 EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir)); | 210 EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir)); |
211 EXPECT_NE(original_user_data_dir, new_user_data_dir); | 211 EXPECT_NE(original_user_data_dir, new_user_data_dir); |
212 | 212 |
213 EXPECT_TRUE(PathService::RemoveOverride(base::DIR_TEMP)); | 213 EXPECT_TRUE(PathService::RemoveOverride(base::DIR_TEMP)); |
214 EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir)); | 214 EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir)); |
215 EXPECT_EQ(original_user_data_dir, new_user_data_dir); | 215 EXPECT_EQ(original_user_data_dir, new_user_data_dir); |
216 } | 216 } |
OLD | NEW |