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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 expirer_.SetDatabases(NULL, NULL); | 144 expirer_.SetDatabases(NULL, NULL); |
145 | 145 |
146 main_db_.reset(); | 146 main_db_.reset(); |
147 thumb_db_.reset(); | 147 thumb_db_.reset(); |
148 } | 148 } |
149 | 149 |
150 // BroadcastNotificationDelegate: | 150 // BroadcastNotificationDelegate: |
151 virtual void BroadcastNotifications( | 151 virtual void BroadcastNotifications( |
152 int type, | 152 int type, |
153 scoped_ptr<HistoryDetails> details) OVERRIDE { | 153 scoped_ptr<HistoryDetails> details) override { |
154 // This gets called when there are notifications to broadcast. Instead, we | 154 // This gets called when there are notifications to broadcast. Instead, we |
155 // store them so we can tell that the correct notifications were sent. | 155 // store them so we can tell that the correct notifications were sent. |
156 notifications_.push_back(std::make_pair(type, details.release())); | 156 notifications_.push_back(std::make_pair(type, details.release())); |
157 } | 157 } |
158 virtual void NotifySyncURLsModified(URLRows* rows) OVERRIDE {} | 158 virtual void NotifySyncURLsModified(URLRows* rows) override {} |
159 virtual void NotifySyncURLsDeleted(bool all_history, | 159 virtual void NotifySyncURLsDeleted(bool all_history, |
160 bool expired, | 160 bool expired, |
161 URLRows* rows) OVERRIDE {} | 161 URLRows* rows) override {} |
162 }; | 162 }; |
163 | 163 |
164 // The example data consists of 4 visits. The middle two visits are to the | 164 // The example data consists of 4 visits. The middle two visits are to the |
165 // same URL, while the first and last are for unique ones. This allows a test | 165 // same URL, while the first and last are for unique ones. This allows a test |
166 // for the oldest or newest to include both a URL that should get totally | 166 // for the oldest or newest to include both a URL that should get totally |
167 // deleted (the one on the end) with one that should only get a visit deleted | 167 // deleted (the one on the end) with one that should only get a visit deleted |
168 // (with the one in the middle) when it picks the proper threshold time. | 168 // (with the one in the middle) when it picks the proper threshold time. |
169 // | 169 // |
170 // Each visit has indexed data, each URL has thumbnail. The first two URLs will | 170 // Each visit has indexed data, each URL has thumbnail. The first two URLs will |
171 // share the same avicon, while the last one will have a unique favicon. The | 171 // share the same avicon, while the last one will have a unique favicon. The |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); | 874 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); |
875 EXPECT_EQ(1U, visits.size()); | 875 EXPECT_EQ(1U, visits.size()); |
876 } | 876 } |
877 | 877 |
878 // TODO(brettw) add some visits with no URL to make sure everything is updated | 878 // TODO(brettw) add some visits with no URL to make sure everything is updated |
879 // properly. Have the visits also refer to nonexistent FTS rows. | 879 // properly. Have the visits also refer to nonexistent FTS rows. |
880 // | 880 // |
881 // Maybe also refer to invalid favicons. | 881 // Maybe also refer to invalid favicons. |
882 | 882 |
883 } // namespace history | 883 } // namespace history |
OLD | NEW |