Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc

Issue 379283002: Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ChromeOS tests Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/test/histogram_tester.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/browser/profiles/profile_metrics.h" 14 #include "chrome/browser/profiles/profile_metrics.h"
14 #include "chrome/browser/profiles/profiles_state.h" 15 #include "chrome/browser/profiles/profiles_state.h"
15 #include "chrome/browser/ui/browser_dialogs.h" 16 #include "chrome/browser/ui/browser_dialogs.h"
16 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
17 #include "chrome/browser/ui/views/frame/browser_view.h" 18 #include "chrome/browser/ui/views/frame/browser_view.h"
18 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" 19 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h"
19 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" 20 #include "chrome/browser/ui/views/profiles/new_avatar_button.h"
20 #include "chrome/browser/ui/views/profiles/user_manager_view.h" 21 #include "chrome/browser/ui/views/profiles/user_manager_view.h"
21 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
22 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
24 #include "chrome/test/base/in_process_browser_test.h" 25 #include "chrome/test/base/in_process_browser_test.h"
25 #include "chrome/test/base/test_switches.h" 26 #include "chrome/test/base/test_switches.h"
26 #include "chrome/test/base/testing_browser_process.h" 27 #include "chrome/test/base/testing_browser_process.h"
27 #include "chrome/test/base/testing_profile_manager.h" 28 #include "chrome/test/base/testing_profile_manager.h"
28 #include "chrome/test/base/uma_histogram_helper.h"
29 #include "components/signin/core/common/profile_management_switches.h" 29 #include "components/signin/core/common/profile_management_switches.h"
30 #include "content/public/test/test_utils.h" 30 #include "content/public/test/test_utils.h"
31 #include "grit/generated_resources.h" 31 #include "grit/generated_resources.h"
32 #include "ui/views/controls/button/label_button.h" 32 #include "ui/views/controls/button/label_button.h"
33 33
34 class ProfileChooserViewBrowserTest : public InProcessBrowserTest { 34 class ProfileChooserViewBrowserTest : public InProcessBrowserTest {
35 public: 35 public:
36 ProfileChooserViewBrowserTest(); 36 ProfileChooserViewBrowserTest();
37 virtual ~ProfileChooserViewBrowserTest(); 37 virtual ~ProfileChooserViewBrowserTest();
38 38
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // 81 //
82 // Mobile platforms are also excluded due to a lack of avatar menu. 82 // Mobile platforms are also excluded due to a lack of avatar menu.
83 #define MAYBE_ViewProfileUMA DISABLED_ViewProfileUMA 83 #define MAYBE_ViewProfileUMA DISABLED_ViewProfileUMA
84 #else 84 #else
85 #define MAYBE_ViewProfileUMA ViewProfileUMA 85 #define MAYBE_ViewProfileUMA ViewProfileUMA
86 #endif 86 #endif
87 87
88 // TODO(mlerman): Re-enable the test to MAYBE_ViewProfileUMA once there is a 88 // TODO(mlerman): Re-enable the test to MAYBE_ViewProfileUMA once there is a
89 // launch plan for EnableAccountConsistency. 89 // launch plan for EnableAccountConsistency.
90 IN_PROC_BROWSER_TEST_F(ProfileChooserViewBrowserTest, DISABLED_ViewProfileUMA) { 90 IN_PROC_BROWSER_TEST_F(ProfileChooserViewBrowserTest, DISABLED_ViewProfileUMA) {
91 UMAHistogramHelper histograms; 91 base::HistogramTester histograms;
92 // If multiprofile mode is not enabled, you can't switch between profiles. 92 // If multiprofile mode is not enabled, you can't switch between profiles.
93 if (!profiles::IsMultipleProfilesEnabled()) 93 if (!profiles::IsMultipleProfilesEnabled())
94 return; 94 return;
95 95
96 Profile* profile = browser()->profile(); 96 Profile* profile = browser()->profile();
97 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0); 97 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0);
98 98
99 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView()); 99 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView());
100 100
101 histograms.Fetch();
102 histograms.ExpectUniqueSample("Profile.UpgradeEnrollment", 101 histograms.ExpectUniqueSample("Profile.UpgradeEnrollment",
103 ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO, 1); 102 ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO, 1);
104 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698