OLD | NEW |
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 Loading... |
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 |
OLD | NEW |