| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile_info_cache.h" | 9 #include "chrome/browser/profiles/profile_info_cache.h" |
| 10 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 10 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // Switch to the first profile without opening a new window. | 247 // Switch to the first profile without opening a new window. |
| 248 profiles::SwitchToProfile(path_profile1, desktop_type, false, | 248 profiles::SwitchToProfile(path_profile1, desktop_type, false, |
| 249 kOnProfileSwitchDoNothing); | 249 kOnProfileSwitchDoNothing); |
| 250 EXPECT_EQ(chrome::GetTotalBrowserCount(), 2U); | 250 EXPECT_EQ(chrome::GetTotalBrowserCount(), 2U); |
| 251 EXPECT_EQ(2U, browser_list->size()); | 251 EXPECT_EQ(2U, browser_list->size()); |
| 252 | 252 |
| 253 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); | 253 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); |
| 254 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); | 254 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, EphemeralProfile) { | 257 #if defined(OS_WIN) |
| 258 // Flakily times out on Windows: http://crbug.com/314905 |
| 259 #define MAYBE_EphemeralProfile DISABLED_EphemeralProfile |
| 260 #else |
| 261 #define MAYBE_EphemeralProfile EphemeralProfile |
| 262 #endif // defined(OS_WIN) |
| 263 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, MAYBE_EphemeralProfile) { |
| 258 #if defined(OS_WIN) && defined(USE_ASH) | 264 #if defined(OS_WIN) && defined(USE_ASH) |
| 259 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 265 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 260 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 266 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
| 261 return; | 267 return; |
| 262 #endif | 268 #endif |
| 263 | 269 |
| 264 // If multiprofile mode is not enabled, you can't switch between profiles. | 270 // If multiprofile mode is not enabled, you can't switch between profiles. |
| 265 if (!profiles::IsMultipleProfilesEnabled()) | 271 if (!profiles::IsMultipleProfilesEnabled()) |
| 266 return; | 272 return; |
| 267 | 273 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 content::RunAllPendingInMessageLoop(); | 323 content::RunAllPendingInMessageLoop(); |
| 318 EXPECT_EQ(1U, browser_list->size()); | 324 EXPECT_EQ(1U, browser_list->size()); |
| 319 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); | 325 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); |
| 320 | 326 |
| 321 // Closing the last window should not reduce the number of profiles. | 327 // Closing the last window should not reduce the number of profiles. |
| 322 browser_list->get(0)->window()->Close(); | 328 browser_list->get(0)->window()->Close(); |
| 323 content::RunAllPendingInMessageLoop(); | 329 content::RunAllPendingInMessageLoop(); |
| 324 EXPECT_EQ(0U, browser_list->size()); | 330 EXPECT_EQ(0U, browser_list->size()); |
| 325 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); | 331 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); |
| 326 } | 332 } |
| OLD | NEW |