| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 // Subsequent calls to a non-crash value should be ignored. | 219 // Subsequent calls to a non-crash value should be ignored. |
| 220 profile->SetExitType(Profile::EXIT_NORMAL); | 220 profile->SetExitType(Profile::EXIT_NORMAL); |
| 221 std::string second_call_value(prefs->GetString(prefs::kSessionExitType)); | 221 std::string second_call_value(prefs->GetString(prefs::kSessionExitType)); |
| 222 EXPECT_EQ(first_call_value, second_call_value); | 222 EXPECT_EQ(first_call_value, second_call_value); |
| 223 | 223 |
| 224 // Setting back to a crashed value should work. | 224 // Setting back to a crashed value should work. |
| 225 profile->SetExitType(Profile::EXIT_CRASHED); | 225 profile->SetExitType(Profile::EXIT_CRASHED); |
| 226 std::string final_value(prefs->GetString(prefs::kSessionExitType)); | 226 std::string final_value(prefs->GetString(prefs::kSessionExitType)); |
| 227 EXPECT_EQ(crash_value, final_value); | 227 EXPECT_EQ(crash_value, final_value); |
| 228 |
| 229 // This test runs fast enough that the WebDataService may still be |
| 230 // initializing (which uses the temp directory) when the test |
| 231 // ends. Give it a chance to complete. |
| 232 profile.reset(); |
| 233 content::RunAllPendingInMessageLoop(); |
| 234 content::RunAllPendingInMessageLoop(content::BrowserThread::DB); |
| 228 } | 235 } |
| OLD | NEW |