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 25 matching lines...) Expand all Loading... |
36 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 36 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
37 BookmarkNode* node) {} | 37 BookmarkNode* node) {} |
38 | 38 |
39 private: | 39 private: |
40 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); | 40 DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 TestingProfile::TestingProfile() | 45 TestingProfile::TestingProfile() |
46 : start_time_(Time::Now()), has_history_service_(false) { | 46 : start_time_(Time::Now()), has_history_service_(false), |
| 47 off_the_record_(false) { |
47 PathService::Get(base::DIR_TEMP, &path_); | 48 PathService::Get(base::DIR_TEMP, &path_); |
48 file_util::AppendToPath(&path_, L"TestingProfilePath"); | 49 file_util::AppendToPath(&path_, L"TestingProfilePath"); |
49 file_util::Delete(path_, true); | 50 file_util::Delete(path_, true); |
50 file_util::CreateDirectory(path_); | 51 file_util::CreateDirectory(path_); |
51 } | 52 } |
52 | 53 |
53 TestingProfile::TestingProfile(int count) | 54 TestingProfile::TestingProfile(int count) |
54 : start_time_(Time::Now()), has_history_service_(false) { | 55 : start_time_(Time::Now()), has_history_service_(false), |
| 56 off_the_record_(false) { |
55 PathService::Get(base::DIR_TEMP, &path_); | 57 PathService::Get(base::DIR_TEMP, &path_); |
56 file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count)); | 58 file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count)); |
57 file_util::Delete(path_, true); | 59 file_util::Delete(path_, true); |
58 file_util::CreateDirectory(path_); | 60 file_util::CreateDirectory(path_); |
59 } | 61 } |
60 | 62 |
61 TestingProfile::~TestingProfile() { | 63 TestingProfile::~TestingProfile() { |
62 DestroyHistoryService(); | 64 DestroyHistoryService(); |
63 file_util::Delete(path_, true); | 65 file_util::Delete(path_, true); |
64 } | 66 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 BookmarkLoadObserver observer; | 127 BookmarkLoadObserver observer; |
126 bookmark_bar_model_->AddObserver(&observer); | 128 bookmark_bar_model_->AddObserver(&observer); |
127 MessageLoop::current()->Run(); | 129 MessageLoop::current()->Run(); |
128 bookmark_bar_model_->RemoveObserver(&observer); | 130 bookmark_bar_model_->RemoveObserver(&observer); |
129 DCHECK(bookmark_bar_model_->IsLoaded()); | 131 DCHECK(bookmark_bar_model_->IsLoaded()); |
130 } | 132 } |
131 | 133 |
132 void TestingProfile::CreateTemplateURLModel() { | 134 void TestingProfile::CreateTemplateURLModel() { |
133 template_url_model_.reset(new TemplateURLModel(this)); | 135 template_url_model_.reset(new TemplateURLModel(this)); |
134 } | 136 } |
OLD | NEW |