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

Side by Side Diff: chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc

Issue 51113006: Fix static set_close_on_deactivate overriding non-virtual base method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change function prototype from set_close_on_deactivate_for_testing(bool close) to clear_close_on_de… 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void NewAvatarMenuButtonTest::StartAvatarMenu() { 74 void NewAvatarMenuButtonTest::StartAvatarMenu() {
75 BrowserView* browser_view = reinterpret_cast<BrowserView*>( 75 BrowserView* browser_view = reinterpret_cast<BrowserView*>(
76 browser()->window()); 76 browser()->window());
77 77
78 // Ensure that the avatar icon button is not also showing. 78 // Ensure that the avatar icon button is not also showing.
79 NewAvatarButton* button = browser_view->frame()->GetNewAvatarMenuButton(); 79 NewAvatarButton* button = browser_view->frame()->GetNewAvatarMenuButton();
80 ASSERT_TRUE(button); 80 ASSERT_TRUE(button);
81 ASSERT_FALSE(browser_view->frame()->GetAvatarMenuButton()); 81 ASSERT_FALSE(browser_view->frame()->GetAvatarMenuButton());
82 82
83 ProfileChooserView::set_close_on_deactivate(false); 83 ProfileChooserView::clear_close_on_deactivate_for_testing();
84 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0); 84 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0);
85 button->NotifyClick(mouse_ev); 85 button->NotifyClick(mouse_ev);
86 base::MessageLoop::current()->RunUntilIdle(); 86 base::MessageLoop::current()->RunUntilIdle();
87 EXPECT_TRUE(ProfileChooserView::IsShowing()); 87 EXPECT_TRUE(ProfileChooserView::IsShowing());
88 } 88 }
89 89
90 IN_PROC_BROWSER_TEST_F(NewAvatarMenuButtonTest, SignOut) { 90 IN_PROC_BROWSER_TEST_F(NewAvatarMenuButtonTest, SignOut) {
91 // If multiprofile mode is not enabled, you can't switch between profiles. 91 // If multiprofile mode is not enabled, you can't switch between profiles.
92 if (!profiles::IsMultipleProfilesEnabled()) 92 if (!profiles::IsMultipleProfilesEnabled())
93 return; 93 return;
(...skipping 20 matching lines...) Expand all
114 ProfileChooserView::profile_bubble_->LinkClicked( 114 ProfileChooserView::profile_bubble_->LinkClicked(
115 static_cast<views::Link*>( 115 static_cast<views::Link*>(
116 ProfileChooserView::profile_bubble_->signout_current_profile_link_), 116 ProfileChooserView::profile_bubble_->signout_current_profile_link_),
117 0); 117 0);
118 118
119 EXPECT_TRUE(menu->GetItemAt(menu->GetActiveProfileIndex()).signin_required); 119 EXPECT_TRUE(menu->GetItemAt(menu->GetActiveProfileIndex()).signin_required);
120 120
121 window_close_observer.Wait(); // Rely on test timeout for failure indication. 121 window_close_observer.Wait(); // Rely on test timeout for failure indication.
122 EXPECT_TRUE(browser_list->empty()); 122 EXPECT_TRUE(browser_list->empty());
123 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button_browsertest.cc ('k') | chrome/browser/ui/views/profile_chooser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698