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

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

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months 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) 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/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/views/avatar_menu_bubble_view.h" 9 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
10 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "chrome/browser/ui/views/frame/browser_view.h"
(...skipping 28 matching lines...) Expand all
39 CreateTestingProfile(); 39 CreateTestingProfile();
40 40
41 BrowserView* browser_view = reinterpret_cast<BrowserView*>( 41 BrowserView* browser_view = reinterpret_cast<BrowserView*>(
42 browser()->window()); 42 browser()->window());
43 AvatarMenuButton* button = browser_view->frame()->GetAvatarMenuButton(); 43 AvatarMenuButton* button = browser_view->frame()->GetAvatarMenuButton();
44 ASSERT_TRUE(button); 44 ASSERT_TRUE(button);
45 45
46 // Verify that clicking once shows the avatar bubble. 46 // Verify that clicking once shows the avatar bubble.
47 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked( 47 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked(
48 NULL, gfx::Point()); 48 NULL, gfx::Point());
49 MessageLoop::current()->RunUntilIdle(); 49 base::MessageLoop::current()->RunUntilIdle();
50 EXPECT_TRUE(AvatarMenuBubbleView::IsShowing()); 50 EXPECT_TRUE(AvatarMenuBubbleView::IsShowing());
51 51
52 // Verify that clicking again doesn't reshow it. 52 // Verify that clicking again doesn't reshow it.
53 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked( 53 static_cast<views::MenuButtonListener*>(button)->OnMenuButtonClicked(
54 NULL, gfx::Point()); 54 NULL, gfx::Point());
55 // Hide the bubble manually. In the browser this would normally happen during 55 // Hide the bubble manually. In the browser this would normally happen during
56 // the event processing. 56 // the event processing.
57 AvatarMenuBubbleView::Hide(); 57 AvatarMenuBubbleView::Hide();
58 MessageLoop::current()->RunUntilIdle(); 58 base::MessageLoop::current()->RunUntilIdle();
59 EXPECT_FALSE(AvatarMenuBubbleView::IsShowing()); 59 EXPECT_FALSE(AvatarMenuBubbleView::IsShowing());
60 } 60 }
61 61
62 } // namespace 62 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/app_list/app_list_controller_win.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698