OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/history/history_backend.h" | 10 #include "chrome/browser/history/history_backend.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 off_the_record_(false), | 80 off_the_record_(false), |
81 last_session_exited_cleanly_(true) { | 81 last_session_exited_cleanly_(true) { |
82 PathService::Get(base::DIR_TEMP, &path_); | 82 PathService::Get(base::DIR_TEMP, &path_); |
83 path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); | 83 path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); |
84 file_util::Delete(path_, true); | 84 file_util::Delete(path_, true); |
85 file_util::CreateDirectory(path_); | 85 file_util::CreateDirectory(path_); |
86 } | 86 } |
87 | 87 |
88 TestingProfile::TestingProfile(int count) | 88 TestingProfile::TestingProfile(int count) |
89 : start_time_(Time::Now()), | 89 : start_time_(Time::Now()), |
| 90 created_theme_provider_(false), |
90 has_history_service_(false), | 91 has_history_service_(false), |
91 off_the_record_(false), | 92 off_the_record_(false), |
92 last_session_exited_cleanly_(true) { | 93 last_session_exited_cleanly_(true) { |
93 PathService::Get(base::DIR_TEMP, &path_); | 94 PathService::Get(base::DIR_TEMP, &path_); |
94 path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); | 95 path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); |
95 path_ = path_.AppendASCII(IntToString(count)); | 96 path_ = path_.AppendASCII(IntToString(count)); |
96 file_util::Delete(path_, true); | 97 file_util::Delete(path_, true); |
97 file_util::CreateDirectory(path_); | 98 file_util::CreateDirectory(path_); |
98 } | 99 } |
99 | 100 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 192 } |
192 | 193 |
193 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { | 194 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { |
194 DCHECK(history_service_.get()); | 195 DCHECK(history_service_.get()); |
195 DCHECK(MessageLoop::current()); | 196 DCHECK(MessageLoop::current()); |
196 | 197 |
197 CancelableRequestConsumer consumer; | 198 CancelableRequestConsumer consumer; |
198 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); | 199 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); |
199 MessageLoop::current()->Run(); | 200 MessageLoop::current()->Run(); |
200 } | 201 } |
OLD | NEW |