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 "chrome/browser/profiles/profile_info_cache.h" | 5 #include "chrome/browser/profiles/profile_info_cache.h" |
6 #include "chrome/browser/profiles/profile_manager.h" | 6 #include "chrome/browser/profiles/profile_manager.h" |
7 #include "chrome/test/base/in_process_browser_test.h" | 7 #include "chrome/test/base/in_process_browser_test.h" |
8 #include "chrome/test/base/testing_browser_process.h" | 8 #include "chrome/test/base/testing_browser_process.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 FilePath new_profile_path = cache.GetPathOfProfileAtIndex(0); | 49 FilePath new_profile_path = cache.GetPathOfProfileAtIndex(0); |
50 EXPECT_NE(new_profile_path, singleton_profile_path); | 50 EXPECT_NE(new_profile_path, singleton_profile_path); |
51 | 51 |
52 // Make sure that last used profile preference is set correctly. | 52 // Make sure that last used profile preference is set correctly. |
53 Profile* last_used = ProfileManager::GetLastUsedProfile(); | 53 Profile* last_used = ProfileManager::GetLastUsedProfile(); |
54 EXPECT_EQ(new_profile_path, last_used->GetPath()); | 54 EXPECT_EQ(new_profile_path, last_used->GetPath()); |
55 } | 55 } |
56 | 56 |
57 // Delete all profiles in a multi profile setup and make sure a new one is | 57 // Delete all profiles in a multi profile setup and make sure a new one is |
58 // created. | 58 // created. |
59 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, DeleteAllProfiles) { | 59 |
| 60 #if defined(OS_MACOSX) |
| 61 // See crbug.com/104851 |
| 62 #define MAYBE_DeleteAllProfiles FLAKY_DeleteAllProfiles |
| 63 #else |
| 64 #define MAYBE_DeleteAllProfiles DeleteAllProfiles |
| 65 #endif |
| 66 |
| 67 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, MAYBE_DeleteAllProfiles) { |
60 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 68 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
61 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 69 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
62 | 70 |
63 // Create an additional profile. | 71 // Create an additional profile. |
64 BlockOnProfileInitObserver observer; | 72 BlockOnProfileInitObserver observer; |
65 FilePath new_path = profile_manager->GenerateNextProfileDirectoryPath(); | 73 FilePath new_path = profile_manager->GenerateNextProfileDirectoryPath(); |
66 profile_manager->CreateProfileAsync(new_path, &observer); | 74 profile_manager->CreateProfileAsync(new_path, &observer); |
67 | 75 |
68 // Spin to allow profile creation to take place, loop is terminated | 76 // Spin to allow profile creation to take place, loop is terminated |
69 // by BlockOnProfileInitObserver when the profile is created. | 77 // by BlockOnProfileInitObserver when the profile is created. |
(...skipping 16 matching lines...) Expand all Loading... |
86 EXPECT_EQ(cache.GetNumberOfProfiles(), 1U); | 94 EXPECT_EQ(cache.GetNumberOfProfiles(), 1U); |
87 FilePath new_profile_path = cache.GetPathOfProfileAtIndex(0); | 95 FilePath new_profile_path = cache.GetPathOfProfileAtIndex(0); |
88 EXPECT_NE(new_profile_path, profile_path1); | 96 EXPECT_NE(new_profile_path, profile_path1); |
89 EXPECT_NE(new_profile_path, profile_path2); | 97 EXPECT_NE(new_profile_path, profile_path2); |
90 | 98 |
91 // Make sure that last used profile preference is set correctly. | 99 // Make sure that last used profile preference is set correctly. |
92 Profile* last_used = ProfileManager::GetLastUsedProfile(); | 100 Profile* last_used = ProfileManager::GetLastUsedProfile(); |
93 EXPECT_EQ(new_profile_path, last_used->GetPath()); | 101 EXPECT_EQ(new_profile_path, last_used->GetPath()); |
94 } | 102 } |
95 #endif // OS_MACOSX | 103 #endif // OS_MACOSX |
OLD | NEW |