| 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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 scoped_ptr<Profile> profile(Profile::CreateProfile( | 132 scoped_ptr<Profile> profile(Profile::CreateProfile( |
| 133 temp_dir.path(), &delegate, Profile::CREATE_MODE_ASYNCHRONOUS)); | 133 temp_dir.path(), &delegate, Profile::CREATE_MODE_ASYNCHRONOUS)); |
| 134 ASSERT_TRUE(profile.get()); | 134 ASSERT_TRUE(profile.get()); |
| 135 | 135 |
| 136 // Wait for the profile to be created. | 136 // Wait for the profile to be created. |
| 137 observer.Wait(); | 137 observer.Wait(); |
| 138 CheckChromeVersion(profile.get(), false); | 138 CheckChromeVersion(profile.get(), false); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // Vista bots were timing out often. http://crbug.com/140882 |
| 142 #if defined(OS_WIN) |
| 143 #define MAYBE_ProfileReadmeCreated DISABLED_ProfileReadmeCreated |
| 144 #else |
| 145 #define MAYBE_ProfileReadmeCreated ProfileReadmeCreated |
| 146 #endif |
| 141 // Test that a README file is created for profiles that didn't have it. | 147 // Test that a README file is created for profiles that didn't have it. |
| 142 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, ProfileReadmeCreated) { | 148 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, MAYBE_ProfileReadmeCreated) { |
| 143 base::ScopedTempDir temp_dir; | 149 base::ScopedTempDir temp_dir; |
| 144 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 150 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 145 | 151 |
| 146 MockProfileDelegate delegate; | 152 MockProfileDelegate delegate; |
| 147 EXPECT_CALL(delegate, OnProfileCreated(testing::NotNull(), true, true)); | 153 EXPECT_CALL(delegate, OnProfileCreated(testing::NotNull(), true, true)); |
| 148 content::WindowedNotificationObserver observer( | 154 content::WindowedNotificationObserver observer( |
| 149 chrome::NOTIFICATION_PROFILE_CREATED, | 155 chrome::NOTIFICATION_PROFILE_CREATED, |
| 150 content::NotificationService::AllSources()); | 156 content::NotificationService::AllSources()); |
| 151 | 157 |
| 152 // No delay before README creation. | 158 // No delay before README creation. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Subsequent calls to a non-crash value should be ignored. | 224 // Subsequent calls to a non-crash value should be ignored. |
| 219 profile->SetExitType(Profile::EXIT_NORMAL); | 225 profile->SetExitType(Profile::EXIT_NORMAL); |
| 220 std::string second_call_value(prefs->GetString(prefs::kSessionExitType)); | 226 std::string second_call_value(prefs->GetString(prefs::kSessionExitType)); |
| 221 EXPECT_EQ(first_call_value, second_call_value); | 227 EXPECT_EQ(first_call_value, second_call_value); |
| 222 | 228 |
| 223 // Setting back to a crashed value should work. | 229 // Setting back to a crashed value should work. |
| 224 profile->SetExitType(Profile::EXIT_CRASHED); | 230 profile->SetExitType(Profile::EXIT_CRASHED); |
| 225 std::string final_value(prefs->GetString(prefs::kSessionExitType)); | 231 std::string final_value(prefs->GetString(prefs::kSessionExitType)); |
| 226 EXPECT_EQ(crash_value, final_value); | 232 EXPECT_EQ(crash_value, final_value); |
| 227 } | 233 } |
| OLD | NEW |