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

Side by Side Diff: chrome/browser/ui/views/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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/avatar_menu_button.h" 5 #include "chrome/browser/ui/views/avatar_menu_button.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 AvatarMenuButton* AvatarMenuButtonTest::GetAvatarMenuButton() { 57 AvatarMenuButton* AvatarMenuButtonTest::GetAvatarMenuButton() {
58 BrowserView* browser_view = reinterpret_cast<BrowserView*>( 58 BrowserView* browser_view = reinterpret_cast<BrowserView*>(
59 browser()->window()); 59 browser()->window());
60 return browser_view->frame()->GetAvatarMenuButton(); 60 return browser_view->frame()->GetAvatarMenuButton();
61 } 61 }
62 62
63 void AvatarMenuButtonTest::StartAvatarMenu() { 63 void AvatarMenuButtonTest::StartAvatarMenu() {
64 AvatarMenuButton* button = GetAvatarMenuButton(); 64 AvatarMenuButton* button = GetAvatarMenuButton();
65 ASSERT_TRUE(button); 65 ASSERT_TRUE(button);
66 66
67 AvatarMenuBubbleView::set_close_on_deactivate(false); 67 AvatarMenuBubbleView::clear_close_on_deactivate_for_testing();
68 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked( 68 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked(
69 NULL, gfx::Point()); 69 NULL, gfx::Point());
70 base::MessageLoop::current()->RunUntilIdle(); 70 base::MessageLoop::current()->RunUntilIdle();
71 EXPECT_TRUE(AvatarMenuBubbleView::IsShowing()); 71 EXPECT_TRUE(AvatarMenuBubbleView::IsShowing());
72 } 72 }
73 73
74 IN_PROC_BROWSER_TEST_F(AvatarMenuButtonTest, HideOnSecondClick) { 74 IN_PROC_BROWSER_TEST_F(AvatarMenuButtonTest, HideOnSecondClick) {
75 #if defined(OS_WIN) && defined(USE_ASH) 75 #if defined(OS_WIN) && defined(USE_ASH)
76 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 76 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
77 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) 77 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
(...skipping 10 matching lines...) Expand all
88 // Verify that clicking again doesn't reshow it. 88 // Verify that clicking again doesn't reshow it.
89 AvatarMenuButton* button = GetAvatarMenuButton(); 89 AvatarMenuButton* button = GetAvatarMenuButton();
90 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked( 90 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked(
91 NULL, gfx::Point()); 91 NULL, gfx::Point());
92 // Hide the bubble manually. In the browser this would normally happen during 92 // Hide the bubble manually. In the browser this would normally happen during
93 // the event processing. 93 // the event processing.
94 AvatarMenuBubbleView::Hide(); 94 AvatarMenuBubbleView::Hide();
95 base::MessageLoop::current()->RunUntilIdle(); 95 base::MessageLoop::current()->RunUntilIdle();
96 EXPECT_FALSE(AvatarMenuBubbleView::IsShowing()); 96 EXPECT_FALSE(AvatarMenuBubbleView::IsShowing());
97 } 97 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.cc ('k') | chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698