OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 ProfileManager::CreateCallback()); | 114 ProfileManager::CreateCallback()); |
115 | 115 |
116 browser_creation_observer.Wait(); | 116 browser_creation_observer.Wait(); |
117 DCHECK_NE(static_cast<Profile*>(nullptr), | 117 DCHECK_NE(static_cast<Profile*>(nullptr), |
118 g_browser_process->profile_manager()->GetProfileByPath( | 118 g_browser_process->profile_manager()->GetProfileByPath( |
119 ProfileManager::GetGuestProfilePath())); | 119 ProfileManager::GetGuestProfilePath())); |
120 EXPECT_EQ(num_browsers + 1, BrowserList::GetInstance()->size()); | 120 EXPECT_EQ(num_browsers + 1, BrowserList::GetInstance()->size()); |
121 | 121 |
122 Profile* guest = g_browser_process->profile_manager()->GetProfileByPath( | 122 Profile* guest = g_browser_process->profile_manager()->GetProfileByPath( |
123 ProfileManager::GetGuestProfilePath()); | 123 ProfileManager::GetGuestProfilePath()); |
124 Browser* browser = chrome::FindAnyBrowser( | 124 Browser* browser = chrome::FindAnyBrowser(guest, true); |
125 guest, true, chrome::GetActiveDesktop()); | |
126 EXPECT_TRUE(browser); | 125 EXPECT_TRUE(browser); |
127 | 126 |
128 // When |browser| closes a BrowsingDataRemover will be created and executed. | 127 // When |browser| closes a BrowsingDataRemover will be created and executed. |
129 // It needs a loaded TemplateUrlService or else it hangs on to a | 128 // It needs a loaded TemplateUrlService or else it hangs on to a |
130 // CallbackList::Subscription forever. | 129 // CallbackList::Subscription forever. |
131 search_test_utils::WaitForTemplateURLServiceToLoad( | 130 search_test_utils::WaitForTemplateURLServiceToLoad( |
132 TemplateURLServiceFactory::GetForProfile(guest)); | 131 TemplateURLServiceFactory::GetForProfile(guest)); |
133 | 132 |
134 return browser; | 133 return browser; |
135 } | 134 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 AppMenuModel model_normal_profile(&accelerator_handler, browser()); | 207 AppMenuModel model_normal_profile(&accelerator_handler, browser()); |
209 EXPECT_NE(-1, model_normal_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); | 208 EXPECT_NE(-1, model_normal_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); |
210 | 209 |
211 // Guest browser has no bookmark menu. | 210 // Guest browser has no bookmark menu. |
212 Browser* guest_browser = OpenGuestBrowser(); | 211 Browser* guest_browser = OpenGuestBrowser(); |
213 AppMenuModel model_guest_profile(&accelerator_handler, guest_browser); | 212 AppMenuModel model_guest_profile(&accelerator_handler, guest_browser); |
214 EXPECT_EQ(-1, model_guest_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); | 213 EXPECT_EQ(-1, model_guest_profile.GetIndexOfCommandId(IDC_BOOKMARKS_MENU)); |
215 } | 214 } |
216 | 215 |
217 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) | 216 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |
OLD | NEW |