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 "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/browser/history/history_backend.h" | 8 #include "chrome/browser/history/history_backend.h" |
9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 38 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
39 BookmarkNode* node) {} | 39 BookmarkNode* node) {} |
40 | 40 |
41 private: | 41 private: |
42 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); | 42 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 TestingProfile::TestingProfile() | 47 TestingProfile::TestingProfile() |
48 : start_time_(Time::Now()), has_history_service_(false), | 48 : start_time_(Time::Now()), |
49 off_the_record_(false) { | 49 has_history_service_(false), |
| 50 off_the_record_(false), |
| 51 last_session_exited_cleanly_(true) { |
50 PathService::Get(base::DIR_TEMP, &path_); | 52 PathService::Get(base::DIR_TEMP, &path_); |
51 file_util::AppendToPath(&path_, L"TestingProfilePath"); | 53 file_util::AppendToPath(&path_, L"TestingProfilePath"); |
52 file_util::Delete(path_, true); | 54 file_util::Delete(path_, true); |
53 file_util::CreateDirectory(path_); | 55 file_util::CreateDirectory(path_); |
54 } | 56 } |
55 | 57 |
56 TestingProfile::TestingProfile(int count) | 58 TestingProfile::TestingProfile(int count) |
57 : start_time_(Time::Now()), has_history_service_(false), | 59 : start_time_(Time::Now()), |
58 off_the_record_(false) { | 60 has_history_service_(false), |
| 61 off_the_record_(false), |
| 62 last_session_exited_cleanly_(true) { |
59 PathService::Get(base::DIR_TEMP, &path_); | 63 PathService::Get(base::DIR_TEMP, &path_); |
60 file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count)); | 64 file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count)); |
61 file_util::Delete(path_, true); | 65 file_util::Delete(path_, true); |
62 file_util::CreateDirectory(path_); | 66 file_util::CreateDirectory(path_); |
63 } | 67 } |
64 | 68 |
65 TestingProfile::~TestingProfile() { | 69 TestingProfile::~TestingProfile() { |
66 DestroyHistoryService(); | 70 DestroyHistoryService(); |
67 file_util::Delete(path_, true); | 71 file_util::Delete(path_, true); |
68 } | 72 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 BookmarkLoadObserver observer; | 133 BookmarkLoadObserver observer; |
130 bookmark_bar_model_->AddObserver(&observer); | 134 bookmark_bar_model_->AddObserver(&observer); |
131 MessageLoop::current()->Run(); | 135 MessageLoop::current()->Run(); |
132 bookmark_bar_model_->RemoveObserver(&observer); | 136 bookmark_bar_model_->RemoveObserver(&observer); |
133 DCHECK(bookmark_bar_model_->IsLoaded()); | 137 DCHECK(bookmark_bar_model_->IsLoaded()); |
134 } | 138 } |
135 | 139 |
136 void TestingProfile::CreateTemplateURLModel() { | 140 void TestingProfile::CreateTemplateURLModel() { |
137 template_url_model_.reset(new TemplateURLModel(this)); | 141 template_url_model_.reset(new TemplateURLModel(this)); |
138 } | 142 } |
OLD | NEW |