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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ViewProfileUMA) { | 245 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ViewProfileUMA) { |
246 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); | 246 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); |
247 | 247 |
248 base::HistogramTester histograms; | 248 base::HistogramTester histograms; |
249 Profile* profile = browser()->profile(); | 249 Profile* profile = browser()->profile(); |
250 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0); | 250 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0); |
251 | 251 |
252 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); | 252 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView(browser())); |
253 | 253 |
254 histograms.ExpectUniqueSample("Profile.NewAvatarMenu.Upgrade", | 254 // The MD user menu doesn't display any upgrade toast so it doesn't log this |
255 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_VIEW, 1); | 255 // in UMA. |
| 256 if (!switches::IsMaterialDesignUserMenu()) { |
| 257 histograms.ExpectUniqueSample("Profile.NewAvatarMenu.Upgrade", |
| 258 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_VIEW, 1); |
| 259 } |
256 } | 260 } |
257 | 261 |
258 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, LockProfile) { | 262 IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, LockProfile) { |
259 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); | 263 ASSERT_TRUE(profiles::IsMultipleProfilesEnabled()); |
260 | 264 |
261 // Set up the message loop for the user manager. | 265 // Set up the message loop for the user manager. |
262 scoped_refptr<content::MessageLoopRunner> runner( | 266 scoped_refptr<content::MessageLoopRunner> runner( |
263 new content::MessageLoopRunner); | 267 new content::MessageLoopRunner); |
264 UserManager::AddOnUserManagerShownCallbackForTesting(runner->QuitClosure()); | 268 UserManager::AddOnUserManagerShownCallbackForTesting(runner->QuitClosure()); |
265 | 269 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // Wait until the user manager is shown. | 343 // Wait until the user manager is shown. |
340 runner->Run(); | 344 runner->Run(); |
341 | 345 |
342 // Assert that the first profile's extensions are not blocked. | 346 // Assert that the first profile's extensions are not blocked. |
343 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); | 347 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); |
344 ASSERT_EQ(0U, registry->blocked_extensions().size()); | 348 ASSERT_EQ(0U, registry->blocked_extensions().size()); |
345 | 349 |
346 // We need to hide the User Manager or else the process can't die. | 350 // We need to hide the User Manager or else the process can't die. |
347 UserManager::Hide(); | 351 UserManager::Hide(); |
348 } | 352 } |
OLD | NEW |