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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonsupervised_index)); | 377 EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonsupervised_index)); |
378 } | 378 } |
379 | 379 |
380 TEST_F(ProfileManagerTest, GetGuestProfilePath) { | 380 TEST_F(ProfileManagerTest, GetGuestProfilePath) { |
381 base::FilePath guest_path = ProfileManager::GetGuestProfilePath(); | 381 base::FilePath guest_path = ProfileManager::GetGuestProfilePath(); |
382 base::FilePath expected_path = temp_dir_.path(); | 382 base::FilePath expected_path = temp_dir_.path(); |
383 expected_path = expected_path.Append(chrome::kGuestProfileDir); | 383 expected_path = expected_path.Append(chrome::kGuestProfileDir); |
384 EXPECT_EQ(expected_path, guest_path); | 384 EXPECT_EQ(expected_path, guest_path); |
385 } | 385 } |
386 | 386 |
| 387 TEST_F(ProfileManagerTest, GetSystemProfilePath) { |
| 388 base::FilePath system_profile_path = ProfileManager::GetSystemProfilePath(); |
| 389 base::FilePath expected_path = temp_dir_.path(); |
| 390 expected_path = expected_path.Append(chrome::kSystemProfileDir); |
| 391 EXPECT_EQ(expected_path, system_profile_path); |
| 392 } |
| 393 |
387 class UnittestGuestProfileManager : public UnittestProfileManager { | 394 class UnittestGuestProfileManager : public UnittestProfileManager { |
388 public: | 395 public: |
389 explicit UnittestGuestProfileManager(const base::FilePath& user_data_dir) | 396 explicit UnittestGuestProfileManager(const base::FilePath& user_data_dir) |
390 : UnittestProfileManager(user_data_dir) {} | 397 : UnittestProfileManager(user_data_dir) {} |
391 | 398 |
392 protected: | 399 protected: |
393 Profile* CreateProfileHelper(const base::FilePath& file_path) override { | 400 Profile* CreateProfileHelper(const base::FilePath& file_path) override { |
394 TestingProfile::Builder builder; | 401 TestingProfile::Builder builder; |
395 builder.SetGuestSession(); | 402 builder.SetGuestSession(); |
396 builder.SetPath(file_path); | 403 builder.SetPath(file_path); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 dest_path2.BaseName().MaybeAsASCII()); | 1298 dest_path2.BaseName().MaybeAsASCII()); |
1292 profile_manager->ScheduleProfileForDeletion(dest_path2, | 1299 profile_manager->ScheduleProfileForDeletion(dest_path2, |
1293 ProfileManager::CreateCallback()); | 1300 ProfileManager::CreateCallback()); |
1294 // Spin the message loop so that all the callbacks can finish running. | 1301 // Spin the message loop so that all the callbacks can finish running. |
1295 base::RunLoop().RunUntilIdle(); | 1302 base::RunLoop().RunUntilIdle(); |
1296 | 1303 |
1297 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); | 1304 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); |
1298 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); | 1305 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); |
1299 } | 1306 } |
1300 #endif // !defined(OS_MACOSX) | 1307 #endif // !defined(OS_MACOSX) |
OLD | NEW |