OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/avatar_menu_model.h" | 5 #include "chrome/browser/profiles/avatar_menu_model.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 return; | 23 return; |
24 | 24 |
25 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 25 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
26 Profile* current_profile = browser()->profile(); | 26 Profile* current_profile = browser()->profile(); |
27 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 27 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
28 size_t index = cache.GetIndexOfProfileWithPath(current_profile->GetPath()); | 28 size_t index = cache.GetIndexOfProfileWithPath(current_profile->GetPath()); |
29 | 29 |
30 AvatarMenuModel model(&cache, NULL, browser()); | 30 AvatarMenuModel model(&cache, NULL, browser()); |
31 | 31 |
32 BrowserList* browser_list = | 32 BrowserList* browser_list = |
33 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); | 33 BrowserList::GetInstance(chrome::GetActiveDesktop()); |
34 EXPECT_EQ(1U, browser_list->size()); | 34 EXPECT_EQ(1U, browser_list->size()); |
35 content::WindowedNotificationObserver window_close_observer( | 35 content::WindowedNotificationObserver window_close_observer( |
36 chrome::NOTIFICATION_BROWSER_CLOSED, | 36 chrome::NOTIFICATION_BROWSER_CLOSED, |
37 content::Source<Browser>(browser())); | 37 content::Source<Browser>(browser())); |
38 | 38 |
39 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index)); | 39 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index)); |
40 model.SetLogoutURL("about:blank"); | 40 model.SetLogoutURL("about:blank"); |
41 model.BeginSignOut(); | 41 model.BeginSignOut(); |
42 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index)); | 42 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index)); |
43 | 43 |
44 window_close_observer.Wait(); // rely on test time-out for failure indication | 44 window_close_observer.Wait(); // rely on test time-out for failure indication |
45 EXPECT_EQ(0U, browser_list->size()); | 45 EXPECT_EQ(0U, browser_list->size()); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
OLD | NEW |