| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/profiles/profiles_state.h" | 10 #include "chrome/browser/profiles/profiles_state.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 NewAvatarMenuButtonTest::NewAvatarMenuButtonTest() { | 42 NewAvatarMenuButtonTest::NewAvatarMenuButtonTest() { |
| 43 } | 43 } |
| 44 | 44 |
| 45 NewAvatarMenuButtonTest::~NewAvatarMenuButtonTest() { | 45 NewAvatarMenuButtonTest::~NewAvatarMenuButtonTest() { |
| 46 } | 46 } |
| 47 | 47 |
| 48 void NewAvatarMenuButtonTest::SetUp() { | 48 void NewAvatarMenuButtonTest::SetUp() { |
| 49 InProcessBrowserTest::SetUp(); | 49 InProcessBrowserTest::SetUp(); |
| 50 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( | 50 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( |
| 51 switches::kNewProfileManagement)); | 51 switches::kEnableNewProfileManagement)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void NewAvatarMenuButtonTest::SetUpCommandLine(CommandLine* command_line) { | 54 void NewAvatarMenuButtonTest::SetUpCommandLine(CommandLine* command_line) { |
| 55 command_line->AppendSwitch(switches::kNewProfileManagement); | 55 command_line->AppendSwitch(switches::kEnableNewProfileManagement); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void NewAvatarMenuButtonTest::CreateTestingProfile() { | 58 void NewAvatarMenuButtonTest::CreateTestingProfile() { |
| 59 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 59 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 60 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); | 60 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); |
| 61 | 61 |
| 62 // Sign in the default profile | 62 // Sign in the default profile |
| 63 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 63 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
| 64 cache.SetUserNameOfProfileAtIndex(0, base::UTF8ToUTF16("user_name")); | 64 cache.SetUserNameOfProfileAtIndex(0, base::UTF8ToUTF16("user_name")); |
| 65 | 65 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 window_close_observer.Wait(); // Rely on test timeout for failure indication. | 132 window_close_observer.Wait(); // Rely on test timeout for failure indication. |
| 133 EXPECT_TRUE(browser_list->empty()); | 133 EXPECT_TRUE(browser_list->empty()); |
| 134 | 134 |
| 135 // If the User Manager hasn't shown yet, wait for it to show up. | 135 // If the User Manager hasn't shown yet, wait for it to show up. |
| 136 if (!UserManagerView::IsShowing()) | 136 if (!UserManagerView::IsShowing()) |
| 137 base::MessageLoop::current()->RunUntilIdle(); | 137 base::MessageLoop::current()->RunUntilIdle(); |
| 138 | 138 |
| 139 // We need to hide the User Manager or else the process can't die. | 139 // We need to hide the User Manager or else the process can't die. |
| 140 chrome::HideUserManager(); | 140 chrome::HideUserManager(); |
| 141 } | 141 } |
| OLD | NEW |