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/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 profiles::SwitchToProfile(path_profile1, desktop_type, false, | 323 profiles::SwitchToProfile(path_profile1, desktop_type, false, |
324 kOnProfileSwitchDoNothing, | 324 kOnProfileSwitchDoNothing, |
325 ProfileMetrics::SWITCH_PROFILE_ICON); | 325 ProfileMetrics::SWITCH_PROFILE_ICON); |
326 EXPECT_EQ(chrome::GetTotalBrowserCount(), 2U); | 326 EXPECT_EQ(chrome::GetTotalBrowserCount(), 2U); |
327 EXPECT_EQ(2U, browser_list->size()); | 327 EXPECT_EQ(2U, browser_list->size()); |
328 | 328 |
329 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); | 329 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); |
330 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); | 330 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); |
331 } | 331 } |
332 | 332 |
333 // This test used to be flakily timing out on Windows: http://crbug.com/314905. | 333 // Flakes on Windows: http://crbug.com/314905 |
334 // If this happens again please make it a MAYBE_ test and reopen that bug. | 334 #if defined(OS_WIN) |
335 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, EphemeralProfile) { | 335 #define MAYBE_EphemeralProfile DISABLED_EphemeralProfile |
| 336 #else |
| 337 #define MAYBE_EphemeralProfile EphemeralProfile |
| 338 #endif |
| 339 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, MAYBE_EphemeralProfile) { |
336 #if defined(OS_WIN) && defined(USE_ASH) | 340 #if defined(OS_WIN) && defined(USE_ASH) |
337 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 341 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
338 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 342 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
339 return; | 343 return; |
340 #endif | 344 #endif |
341 | 345 |
342 // If multiprofile mode is not enabled, you can't switch between profiles. | 346 // If multiprofile mode is not enabled, you can't switch between profiles. |
343 if (!profiles::IsMultipleProfilesEnabled()) | 347 if (!profiles::IsMultipleProfilesEnabled()) |
344 return; | 348 return; |
345 | 349 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 run_loop.QuitClosure()); | 443 run_loop.QuitClosure()); |
440 EXPECT_TRUE(password_store->ScheduleTask(task)); | 444 EXPECT_TRUE(password_store->ScheduleTask(task)); |
441 run_loop.Run(); | 445 run_loop.Run(); |
442 | 446 |
443 EXPECT_TRUE(verify_add.IsCalled()); | 447 EXPECT_TRUE(verify_add.IsCalled()); |
444 EXPECT_EQ(1u, verify_add.GetPasswords().size()); | 448 EXPECT_EQ(1u, verify_add.GetPasswords().size()); |
445 EXPECT_TRUE(verify_delete.IsCalled()); | 449 EXPECT_TRUE(verify_delete.IsCalled()); |
446 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); | 450 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); |
447 } | 451 } |
448 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 452 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
OLD | NEW |