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