| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/avatar_menu_button.h" | 5 #include "chrome/browser/ui/views/avatar_menu_button.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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" | 
| 10 #include "chrome/browser/profiles/avatar_menu_model.h" | 10 #include "chrome/browser/profiles/avatar_menu_model.h" | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 67     switches::kNewProfileManagement); | 67     switches::kNewProfileManagement); | 
| 68 } | 68 } | 
| 69 | 69 | 
| 70 void AvatarMenuButtonTest::CreateTestingProfile() { | 70 void AvatarMenuButtonTest::CreateTestingProfile() { | 
| 71   ProfileManager* profile_manager = g_browser_process->profile_manager(); | 71   ProfileManager* profile_manager = g_browser_process->profile_manager(); | 
| 72   EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); | 72   EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); | 
| 73 | 73 | 
| 74   base::FilePath path; | 74   base::FilePath path; | 
| 75   PathService::Get(chrome::DIR_USER_DATA, &path); | 75   PathService::Get(chrome::DIR_USER_DATA, &path); | 
| 76   path = path.AppendASCII("test_profile"); | 76   path = path.AppendASCII("test_profile"); | 
| 77   if (!file_util::PathExists(path)) | 77   if (!base::PathExists(path)) | 
| 78     ASSERT_TRUE(file_util::CreateDirectory(path)); | 78     ASSERT_TRUE(file_util::CreateDirectory(path)); | 
| 79   Profile* profile = | 79   Profile* profile = | 
| 80       Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 80       Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 
| 81   profile_manager->RegisterTestingProfile(profile, true, false); | 81   profile_manager->RegisterTestingProfile(profile, true, false); | 
| 82 | 82 | 
| 83   EXPECT_EQ(2u, profile_manager->GetNumberOfProfiles()); | 83   EXPECT_EQ(2u, profile_manager->GetNumberOfProfiles()); | 
| 84 } | 84 } | 
| 85 | 85 | 
| 86 AvatarMenuButton* AvatarMenuButtonTest::GetAvatarMenuButton() { | 86 AvatarMenuButton* AvatarMenuButtonTest::GetAvatarMenuButton() { | 
| 87   BrowserView* browser_view = reinterpret_cast<BrowserView*>( | 87   BrowserView* browser_view = reinterpret_cast<BrowserView*>( | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 154 | 154 | 
| 155   EXPECT_TRUE(model->GetItemAt(model->GetActiveProfileIndex()).signin_required); | 155   EXPECT_TRUE(model->GetItemAt(model->GetActiveProfileIndex()).signin_required); | 
| 156 | 156 | 
| 157   window_close_observer.Wait();  // Rely on test timeout for failure indication. | 157   window_close_observer.Wait();  // Rely on test timeout for failure indication. | 
| 158   EXPECT_TRUE(browser_list->empty()); | 158   EXPECT_TRUE(browser_list->empty()); | 
| 159 } | 159 } | 
| 160 | 160 | 
| 161 | 161 | 
| 162 INSTANTIATE_TEST_CASE_P(Old, AvatarMenuButtonTest, testing::Values(false)); | 162 INSTANTIATE_TEST_CASE_P(Old, AvatarMenuButtonTest, testing::Values(false)); | 
| 163 INSTANTIATE_TEST_CASE_P(New, AvatarMenuButtonTest, testing::Values(true)); | 163 INSTANTIATE_TEST_CASE_P(New, AvatarMenuButtonTest, testing::Values(true)); | 
| OLD | NEW | 
|---|