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

Side by Side Diff: chrome/browser/ui/views/new_avatar_menu_button_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 chrome::NOTIFICATION_BROWSER_CLOSED, 104 chrome::NOTIFICATION_BROWSER_CLOSED,
105 content::Source<Browser>(browser())); 105 content::Source<Browser>(browser()));
106 106
107 AvatarMenu* menu = 107 AvatarMenu* menu =
108 ProfileChooserView::profile_bubble_->avatar_menu_.get(); 108 ProfileChooserView::profile_bubble_->avatar_menu_.get();
109 const AvatarMenu::Item& menu_item_before = 109 const AvatarMenu::Item& menu_item_before =
110 menu->GetItemAt(menu->GetActiveProfileIndex()); 110 menu->GetItemAt(menu->GetActiveProfileIndex());
111 EXPECT_FALSE(menu_item_before.signin_required); 111 EXPECT_FALSE(menu_item_before.signin_required);
112 112
113 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0); 113 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0);
114 menu->SetLogoutURL("about:blank");
115 114
116 ProfileChooserView::profile_bubble_->LinkClicked( 115 ProfileChooserView::profile_bubble_->LinkClicked(
117 static_cast<views::Link*>( 116 static_cast<views::Link*>(
118 ProfileChooserView::profile_bubble_->signout_current_profile_link_), 117 ProfileChooserView::profile_bubble_->signout_current_profile_link_),
119 0); 118 0);
120 119
121 EXPECT_TRUE(menu->GetItemAt(menu->GetActiveProfileIndex()).signin_required); 120 EXPECT_TRUE(menu->GetItemAt(menu->GetActiveProfileIndex()).signin_required);
122 121
123 window_close_observer.Wait(); // Rely on test timeout for failure indication. 122 window_close_observer.Wait(); // Rely on test timeout for failure indication.
124 EXPECT_TRUE(browser_list->empty()); 123 EXPECT_TRUE(browser_list->empty());
125 124
126 // If the User Manager hasn't shown yet, wait for it to show up. 125 // If the User Manager hasn't shown yet, wait for it to show up.
127 if (!UserManagerView::IsShowing()) 126 if (!UserManagerView::IsShowing())
128 base::MessageLoop::current()->RunUntilIdle(); 127 base::MessageLoop::current()->RunUntilIdle();
129 128
130 // We need to hide the User Manager or else the process can't die. 129 // We need to hide the User Manager or else the process can't die.
131 chrome::HideUserManager(); 130 chrome::HideUserManager();
132 } 131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698