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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 Profile* profile, | 48 Profile* profile, |
49 Profile::CreateStatus status) { | 49 Profile::CreateStatus status) { |
50 if (status == Profile::CREATE_STATUS_INITIALIZED) | 50 if (status == Profile::CREATE_STATUS_INITIALIZED) |
51 run_loop->Quit(); | 51 run_loop->Quit(); |
52 } | 52 } |
53 | 53 |
54 void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { | 54 void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { |
55 ASSERT_NE(status, Profile::CREATE_STATUS_LOCAL_FAIL); | 55 ASSERT_NE(status, Profile::CREATE_STATUS_LOCAL_FAIL); |
56 ASSERT_NE(status, Profile::CREATE_STATUS_REMOTE_FAIL); | 56 ASSERT_NE(status, Profile::CREATE_STATUS_REMOTE_FAIL); |
57 // No browser should have been created for this profile yet. | 57 // No browser should have been created for this profile yet. |
58 EXPECT_EQ(chrome::GetTotalBrowserCountForProfile(profile), 0U); | 58 EXPECT_EQ(chrome::GetBrowserCount(profile), 0U); |
59 EXPECT_EQ(chrome::GetTotalBrowserCount(), 1U); | 59 EXPECT_EQ(chrome::GetTotalBrowserCount(), 1U); |
60 if (status == Profile::CREATE_STATUS_INITIALIZED) | 60 if (status == Profile::CREATE_STATUS_INITIALIZED) |
61 base::MessageLoop::current()->QuitWhenIdle(); | 61 base::MessageLoop::current()->QuitWhenIdle(); |
62 } | 62 } |
63 | 63 |
64 void EphemeralProfileCreationComplete(Profile* profile, | 64 void EphemeralProfileCreationComplete(Profile* profile, |
65 Profile::CreateStatus status) { | 65 Profile::CreateStatus status) { |
66 if (status == Profile::CREATE_STATUS_INITIALIZED) | 66 if (status == Profile::CREATE_STATUS_INITIALIZED) |
67 profile->GetPrefs()->SetBoolean(prefs::kForceEphemeralProfiles, true); | 67 profile->GetPrefs()->SetBoolean(prefs::kForceEphemeralProfiles, true); |
68 ProfileCreationComplete(profile, status); | 68 ProfileCreationComplete(profile, status); |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 ASSERT_TRUE(profile_manager->IsValidProfile(incognito_profile)); | 487 ASSERT_TRUE(profile_manager->IsValidProfile(incognito_profile)); |
488 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); | 488 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); |
489 | 489 |
490 // Delete the incognito profile. | 490 // Delete the incognito profile. |
491 incognito_profile->GetOriginalProfile()->DestroyOffTheRecordProfile(); | 491 incognito_profile->GetOriginalProfile()->DestroyOffTheRecordProfile(); |
492 | 492 |
493 EXPECT_FALSE(profile->HasOffTheRecordProfile()); | 493 EXPECT_FALSE(profile->HasOffTheRecordProfile()); |
494 EXPECT_FALSE(profile_manager->IsValidProfile(incognito_profile)); | 494 EXPECT_FALSE(profile_manager->IsValidProfile(incognito_profile)); |
495 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); | 495 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); |
496 } | 496 } |
OLD | NEW |