| 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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ProfileImpl::create_readme_delay_ms = 0; | 179 ProfileImpl::create_readme_delay_ms = 0; |
| 180 | 180 |
| 181 scoped_ptr<Profile> profile(Profile::CreateProfile( | 181 scoped_ptr<Profile> profile(Profile::CreateProfile( |
| 182 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); | 182 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); |
| 183 ASSERT_TRUE(profile.get()); | 183 ASSERT_TRUE(profile.get()); |
| 184 | 184 |
| 185 // Delete the Profile instance and run pending tasks (this includes the task | 185 // Delete the Profile instance and run pending tasks (this includes the task |
| 186 // for README creation). | 186 // for README creation). |
| 187 profile.reset(); | 187 profile.reset(); |
| 188 content::RunAllPendingInMessageLoop(); | 188 content::RunAllPendingInMessageLoop(); |
| 189 content::RunAllPendingInMessageLoop(content::BrowserThread::DB); |
| 189 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 190 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
| 190 } | 191 } |
| 191 | 192 |
| 192 // Test that repeated setting of exit type is handled correctly. | 193 // Test that repeated setting of exit type is handled correctly. |
| 193 #if defined(OS_WIN) | 194 #if defined(OS_WIN) |
| 194 // Flaky on Windows: http://crbug.com/163713 | 195 // Flaky on Windows: http://crbug.com/163713 |
| 195 #define MAYBE_ExitType DISABLED_ExitType | 196 #define MAYBE_ExitType DISABLED_ExitType |
| 196 #else | 197 #else |
| 197 #define MAYBE_ExitType ExitType | 198 #define MAYBE_ExitType ExitType |
| 198 #endif | 199 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 226 std::string final_value(prefs->GetString(prefs::kSessionExitType)); | 227 std::string final_value(prefs->GetString(prefs::kSessionExitType)); |
| 227 EXPECT_EQ(crash_value, final_value); | 228 EXPECT_EQ(crash_value, final_value); |
| 228 | 229 |
| 229 // This test runs fast enough that the WebDataService may still be | 230 // This test runs fast enough that the WebDataService may still be |
| 230 // initializing (which uses the temp directory) when the test | 231 // initializing (which uses the temp directory) when the test |
| 231 // ends. Give it a chance to complete. | 232 // ends. Give it a chance to complete. |
| 232 profile.reset(); | 233 profile.reset(); |
| 233 content::RunAllPendingInMessageLoop(); | 234 content::RunAllPendingInMessageLoop(); |
| 234 content::RunAllPendingInMessageLoop(content::BrowserThread::DB); | 235 content::RunAllPendingInMessageLoop(content::BrowserThread::DB); |
| 235 } | 236 } |
| OLD | NEW |