Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 ProfileChooserViewBrowserTest::ProfileChooserViewBrowserTest() { | 48 ProfileChooserViewBrowserTest::ProfileChooserViewBrowserTest() { |
| 49 } | 49 } |
| 50 | 50 |
| 51 ProfileChooserViewBrowserTest::~ProfileChooserViewBrowserTest() { | 51 ProfileChooserViewBrowserTest::~ProfileChooserViewBrowserTest() { |
| 52 } | 52 } |
| 53 | 53 |
| 54 void ProfileChooserViewBrowserTest::SetUp() { | 54 void ProfileChooserViewBrowserTest::SetUp() { |
| 55 InProcessBrowserTest::SetUp(); | 55 InProcessBrowserTest::SetUp(); |
| 56 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( | |
|
msw
2014/08/01 16:45:14
Should this instead ASSERT_EQ/EXPECT_EQ switches::
Mike Lerman
2014/08/01 19:15:00
Done.
| |
| 57 switches::kNewAvatarMenu)); | |
| 58 } | 56 } |
| 59 | 57 |
| 60 void ProfileChooserViewBrowserTest::SetUpCommandLine( | 58 void ProfileChooserViewBrowserTest::SetUpCommandLine( |
| 61 CommandLine* command_line) { | 59 CommandLine* command_line) { |
| 62 command_line->AppendSwitch(switches::kNewAvatarMenu); | |
| 63 } | 60 } |
| 64 | 61 |
| 65 void ProfileChooserViewBrowserTest::OpenProfileChooserView() { | 62 void ProfileChooserViewBrowserTest::OpenProfileChooserView() { |
| 66 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); | 63 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); |
| 67 NewAvatarButton* button = browser_view->frame()->GetNewAvatarMenuButton(); | 64 NewAvatarButton* button = browser_view->frame()->GetNewAvatarMenuButton(); |
| 68 ASSERT_TRUE(button); | 65 ASSERT_TRUE(button); |
| 69 | 66 |
| 70 ProfileChooserView::clear_close_on_deactivate_for_testing(); | 67 ProfileChooserView::clear_close_on_deactivate_for_testing(); |
| 71 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0, | 68 ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0, |
| 72 0); | 69 0); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 95 | 92 |
| 96 Profile* profile = browser()->profile(); | 93 Profile* profile = browser()->profile(); |
| 97 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0); | 94 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarTutorialShown, 0); |
| 98 | 95 |
| 99 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView()); | 96 ASSERT_NO_FATAL_FAILURE(OpenProfileChooserView()); |
| 100 | 97 |
| 101 histograms.Fetch(); | 98 histograms.Fetch(); |
| 102 histograms.ExpectUniqueSample("Profile.UpgradeEnrollment", | 99 histograms.ExpectUniqueSample("Profile.UpgradeEnrollment", |
| 103 ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO, 1); | 100 ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO, 1); |
| 104 } | 101 } |
| OLD | NEW |