Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/profiles/profile_list_desktop_browsertest.cc

Issue 64313005: Fix crash when locking a profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/profiles/avatar_menu.h" 8 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/profiles/profiles_state.h" 10 #include "chrome/browser/profiles/profiles_state.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 menu->RebuildMenu(); 60 menu->RebuildMenu();
61 61
62 BrowserList* browser_list = 62 BrowserList* browser_list =
63 BrowserList::GetInstance(chrome::GetActiveDesktop()); 63 BrowserList::GetInstance(chrome::GetActiveDesktop());
64 EXPECT_EQ(1U, browser_list->size()); 64 EXPECT_EQ(1U, browser_list->size());
65 content::WindowedNotificationObserver window_close_observer( 65 content::WindowedNotificationObserver window_close_observer(
66 chrome::NOTIFICATION_BROWSER_CLOSED, 66 chrome::NOTIFICATION_BROWSER_CLOSED,
67 content::Source<Browser>(browser())); 67 content::Source<Browser>(browser()));
68 68
69 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index)); 69 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index));
70 menu->SetLogoutURL("about:blank");
71 menu->BeginSignOut(); 70 menu->BeginSignOut();
72 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index)); 71 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index));
73 72
74 window_close_observer.Wait(); // rely on test time-out for failure indication 73 window_close_observer.Wait(); // rely on test time-out for failure indication
75 EXPECT_EQ(0U, browser_list->size()); 74 EXPECT_EQ(0U, browser_list->size());
76 } 75 }
77 76
78 IN_PROC_BROWSER_TEST_F(ProfileListDesktopBrowserTest, SwitchToProfile) { 77 IN_PROC_BROWSER_TEST_F(ProfileListDesktopBrowserTest, SwitchToProfile) {
79 #if defined(OS_WIN) && defined(USE_ASH) 78 #if defined(OS_WIN) && defined(USE_ASH)
80 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 79 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Open a browser window for the second profile. 117 // Open a browser window for the second profile.
119 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile2), false); 118 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile2), false);
120 EXPECT_EQ(2U, browser_list->size()); 119 EXPECT_EQ(2U, browser_list->size());
121 120
122 // Switch to the first profile without opening a new window. 121 // Switch to the first profile without opening a new window.
123 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), false); 122 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), false);
124 EXPECT_EQ(2U, browser_list->size()); 123 EXPECT_EQ(2U, browser_list->size());
125 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); 124 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath());
126 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); 125 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath());
127 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698