| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 typedef std::vector< std::pair<int, HistoryDetails*> > | 126 typedef std::vector< std::pair<int, HistoryDetails*> > |
| 127 NotificationList; | 127 NotificationList; |
| 128 NotificationList notifications_; | 128 NotificationList notifications_; |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 void SetUp() { | 131 void SetUp() { |
| 132 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); | 132 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); |
| 133 | 133 |
| 134 FilePath history_name = path().Append(kHistoryFile); | 134 FilePath history_name = path().Append(kHistoryFile); |
| 135 main_db_.reset(new HistoryDatabase); | 135 main_db_.reset(new HistoryDatabase); |
| 136 if (main_db_->Init(history_name, FilePath()) != sql::INIT_OK) | 136 if (main_db_->Init(history_name) != sql::INIT_OK) |
| 137 main_db_.reset(); | 137 main_db_.reset(); |
| 138 | 138 |
| 139 FilePath archived_name = path().Append(kArchivedHistoryFile); | 139 FilePath archived_name = path().Append(kArchivedHistoryFile); |
| 140 archived_db_.reset(new ArchivedDatabase); | 140 archived_db_.reset(new ArchivedDatabase); |
| 141 if (!archived_db_->Init(archived_name)) | 141 if (!archived_db_->Init(archived_name)) |
| 142 archived_db_.reset(); | 142 archived_db_.reset(); |
| 143 | 143 |
| 144 FilePath thumb_name = path().Append(kThumbnailFile); | 144 FilePath thumb_name = path().Append(kThumbnailFile); |
| 145 thumb_db_.reset(new ThumbnailDatabase); | 145 thumb_db_.reset(new ThumbnailDatabase); |
| 146 if (thumb_db_->Init(thumb_name, NULL, main_db_.get()) != sql::INIT_OK) | 146 if (thumb_db_->Init(thumb_name, NULL, main_db_.get()) != sql::INIT_OK) |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 main_db_->GetVisitsForURL(url_id, &archived_visits); | 953 main_db_->GetVisitsForURL(url_id, &archived_visits); |
| 954 EXPECT_EQ(0U, archived_visits.size()); | 954 EXPECT_EQ(0U, archived_visits.size()); |
| 955 } | 955 } |
| 956 | 956 |
| 957 // TODO(brettw) add some visits with no URL to make sure everything is updated | 957 // TODO(brettw) add some visits with no URL to make sure everything is updated |
| 958 // properly. Have the visits also refer to nonexistent FTS rows. | 958 // properly. Have the visits also refer to nonexistent FTS rows. |
| 959 // | 959 // |
| 960 // Maybe also refer to invalid favicons. | 960 // Maybe also refer to invalid favicons. |
| 961 | 961 |
| 962 } // namespace history | 962 } // namespace history |
| OLD | NEW |