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 DCHECK(ProfileChooserView::profile_bubble_); | |
msw
2015/07/13 21:37:30
nit: this isn't needed.
wjmaclean
2015/07/14 12:26:18
Done.
| |
173 return ProfileChooserView::profile_bubble_->signin_current_profile_link_; | |
174 } | |
175 | |
171 void ShowSigninView() { | 176 void ShowSigninView() { |
172 DCHECK(current_profile_bubble()); | 177 DCHECK(current_profile_bubble()); |
173 DCHECK(current_profile_bubble()->avatar_menu_); | 178 DCHECK(current_profile_bubble()->avatar_menu_); |
174 current_profile_bubble()->ShowView( | 179 current_profile_bubble()->ShowView( |
175 profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, | 180 profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, |
176 current_profile_bubble()->avatar_menu_.get()); | 181 current_profile_bubble()->avatar_menu_.get()); |
177 base::MessageLoop::current()->RunUntilIdle(); | 182 base::MessageLoop::current()->RunUntilIdle(); |
178 } | 183 } |
179 | 184 |
180 private: | 185 private: |
181 scoped_ptr<content::WindowedNotificationObserver> window_close_observer_; | 186 scoped_ptr<content::WindowedNotificationObserver> window_close_observer_; |
182 | 187 |
183 DISALLOW_COPY_AND_ASSIGN(ProfileChooserViewExtensionsTest); | 188 DISALLOW_COPY_AND_ASSIGN(ProfileChooserViewExtensionsTest); |
184 }; | 189 }; |
185 | 190 |
191 // crbug.com/449088 | |
192 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, SigninButtonHasFocus) { | |
193 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); | |
194 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); | |
195 | |
196 EXPECT_TRUE(signin_current_profile_link()->HasFocus()); | |
197 } | |
198 | |
186 // crbug.com/502370 | 199 // crbug.com/502370 |
187 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ContentAreaHasFocus) { | 200 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ContentAreaHasFocus) { |
188 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); | 201 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); |
189 | 202 |
190 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); | 203 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); |
191 | 204 |
192 ShowSigninView(); | 205 ShowSigninView(); |
193 | 206 |
194 ASSERT_TRUE(current_profile_bubble()); | 207 ASSERT_TRUE(current_profile_bubble()); |
195 views::View* web_view = FindWebView(current_profile_bubble()); | 208 views::View* web_view = FindWebView(current_profile_bubble()); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 WaitForUserManager(); | 296 WaitForUserManager(); |
284 // Assert that the first profile's extensions are not blocked. | 297 // Assert that the first profile's extensions are not blocked. |
285 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); | 298 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); |
286 ASSERT_EQ(0U, registry->blocked_extensions().size()); | 299 ASSERT_EQ(0U, registry->blocked_extensions().size()); |
287 | 300 |
288 // We need to hide the User Manager or else the process can't die. | 301 // We need to hide the User Manager or else the process can't die. |
289 UserManager::Hide(); | 302 UserManager::Hide(); |
290 } | 303 } |
291 | 304 |
292 #endif | 305 #endif |
OLD | NEW |