| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 content::WindowedNotificationObserver* window_close_observer() { | 163 content::WindowedNotificationObserver* window_close_observer() { |
| 164 return window_close_observer_.get(); | 164 return window_close_observer_.get(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 ProfileChooserView* current_profile_bubble() { | 167 ProfileChooserView* current_profile_bubble() { |
| 168 return ProfileChooserView::profile_bubble_; | 168 return ProfileChooserView::profile_bubble_; |
| 169 } | 169 } |
| 170 | 170 |
| 171 views::View* signin_current_profile_link() { |
| 172 return ProfileChooserView::profile_bubble_->signin_current_profile_link_; |
| 173 } |
| 174 |
| 171 void ShowSigninView() { | 175 void ShowSigninView() { |
| 172 DCHECK(current_profile_bubble()); | 176 DCHECK(current_profile_bubble()); |
| 173 DCHECK(current_profile_bubble()->avatar_menu_); | 177 DCHECK(current_profile_bubble()->avatar_menu_); |
| 174 current_profile_bubble()->ShowView( | 178 current_profile_bubble()->ShowView( |
| 175 profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, | 179 profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, |
| 176 current_profile_bubble()->avatar_menu_.get()); | 180 current_profile_bubble()->avatar_menu_.get()); |
| 177 base::MessageLoop::current()->RunUntilIdle(); | 181 base::MessageLoop::current()->RunUntilIdle(); |
| 178 } | 182 } |
| 179 | 183 |
| 180 private: | 184 private: |
| 181 scoped_ptr<content::WindowedNotificationObserver> window_close_observer_; | 185 scoped_ptr<content::WindowedNotificationObserver> window_close_observer_; |
| 182 | 186 |
| 183 DISALLOW_COPY_AND_ASSIGN(ProfileChooserViewExtensionsTest); | 187 DISALLOW_COPY_AND_ASSIGN(ProfileChooserViewExtensionsTest); |
| 184 }; | 188 }; |
| 185 | 189 |
| 186 // crbug.com/502370 | 190 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, SigninButtonHasFocus) { |
| 191 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); |
| 192 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); |
| 193 |
| 194 EXPECT_TRUE(signin_current_profile_link()->HasFocus()); |
| 195 } |
| 196 |
| 187 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ContentAreaHasFocus) { | 197 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ContentAreaHasFocus) { |
| 188 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); | 198 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); |
| 189 | 199 |
| 190 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); | 200 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); |
| 191 | 201 |
| 192 ShowSigninView(); | 202 ShowSigninView(); |
| 193 | 203 |
| 194 ASSERT_TRUE(current_profile_bubble()); | 204 ASSERT_TRUE(current_profile_bubble()); |
| 195 views::View* web_view = FindWebView(current_profile_bubble()); | 205 views::View* web_view = FindWebView(current_profile_bubble()); |
| 196 ASSERT_TRUE(web_view); | 206 ASSERT_TRUE(web_view); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 WaitForUserManager(); | 293 WaitForUserManager(); |
| 284 // Assert that the first profile's extensions are not blocked. | 294 // Assert that the first profile's extensions are not blocked. |
| 285 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); | 295 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); |
| 286 ASSERT_EQ(0U, registry->blocked_extensions().size()); | 296 ASSERT_EQ(0U, registry->blocked_extensions().size()); |
| 287 | 297 |
| 288 // We need to hide the User Manager or else the process can't die. | 298 // We need to hide the User Manager or else the process can't die. |
| 289 UserManager::Hide(); | 299 UserManager::Hide(); |
| 290 } | 300 } |
| 291 | 301 |
| 292 #endif | 302 #endif |
| OLD | NEW |