| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); | 59 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); |
| 60 | 60 |
| 61 // Sign in the default profile | 61 // Sign in the default profile |
| 62 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 62 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
| 63 cache.SetUserNameOfProfileAtIndex(0, UTF8ToUTF16("user_name")); | 63 cache.SetUserNameOfProfileAtIndex(0, UTF8ToUTF16("user_name")); |
| 64 | 64 |
| 65 base::FilePath path; | 65 base::FilePath path; |
| 66 PathService::Get(chrome::DIR_USER_DATA, &path); | 66 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 67 path = path.AppendASCII("test_profile"); | 67 path = path.AppendASCII("test_profile"); |
| 68 if (!base::PathExists(path)) | 68 if (!base::PathExists(path)) |
| 69 ASSERT_TRUE(file_util::CreateDirectory(path)); | 69 ASSERT_TRUE(base::CreateDirectory(path)); |
| 70 Profile* profile = | 70 Profile* profile = |
| 71 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 71 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
| 72 profile_manager->RegisterTestingProfile(profile, true, false); | 72 profile_manager->RegisterTestingProfile(profile, true, false); |
| 73 EXPECT_EQ(2u, profile_manager->GetNumberOfProfiles()); | 73 EXPECT_EQ(2u, profile_manager->GetNumberOfProfiles()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void NewAvatarMenuButtonTest::StartAvatarMenu() { | 76 void NewAvatarMenuButtonTest::StartAvatarMenu() { |
| 77 BrowserView* browser_view = reinterpret_cast<BrowserView*>( | 77 BrowserView* browser_view = reinterpret_cast<BrowserView*>( |
| 78 browser()->window()); | 78 browser()->window()); |
| 79 | 79 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 window_close_observer.Wait(); // Rely on test timeout for failure indication. | 120 window_close_observer.Wait(); // Rely on test timeout for failure indication. |
| 121 EXPECT_TRUE(browser_list->empty()); | 121 EXPECT_TRUE(browser_list->empty()); |
| 122 | 122 |
| 123 // If the User Manager hasn't shown yet, wait for it to show up. | 123 // If the User Manager hasn't shown yet, wait for it to show up. |
| 124 if (!UserManagerView::IsShowing()) | 124 if (!UserManagerView::IsShowing()) |
| 125 base::MessageLoop::current()->RunUntilIdle(); | 125 base::MessageLoop::current()->RunUntilIdle(); |
| 126 | 126 |
| 127 // We need to hide the User Manager or else the process can't die. | 127 // We need to hide the User Manager or else the process can't die. |
| 128 chrome::HideUserManager(); | 128 chrome::HideUserManager(); |
| 129 } | 129 } |
| OLD | NEW |