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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 class HistoryBackendTestBase; | 115 class HistoryBackendTestBase; |
116 | 116 |
117 // This must be a separate object since HistoryBackend manages its lifetime. | 117 // This must be a separate object since HistoryBackend manages its lifetime. |
118 // This just forwards the messages we're interested in to the test object. | 118 // This just forwards the messages we're interested in to the test object. |
119 class HistoryBackendTestDelegate : public HistoryBackend::Delegate { | 119 class HistoryBackendTestDelegate : public HistoryBackend::Delegate { |
120 public: | 120 public: |
121 explicit HistoryBackendTestDelegate(HistoryBackendTestBase* test) | 121 explicit HistoryBackendTestDelegate(HistoryBackendTestBase* test) |
122 : test_(test) {} | 122 : test_(test) {} |
123 | 123 |
124 void NotifyProfileError(sql::InitStatus init_status) override {} | 124 void NotifyProfileError(sql::InitStatus init_status, |
| 125 const std::string& diagnostics) override {} |
125 void SetInMemoryBackend( | 126 void SetInMemoryBackend( |
126 std::unique_ptr<InMemoryHistoryBackend> backend) override; | 127 std::unique_ptr<InMemoryHistoryBackend> backend) override; |
127 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 128 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
128 const GURL& icon_url) override; | 129 const GURL& icon_url) override; |
129 void NotifyURLVisited(ui::PageTransition transition, | 130 void NotifyURLVisited(ui::PageTransition transition, |
130 const URLRow& row, | 131 const URLRow& row, |
131 const RedirectList& redirects, | 132 const RedirectList& redirects, |
132 base::Time visit_time) override; | 133 base::Time visit_time) override; |
133 void NotifyURLsModified(const URLRows& changed_urls) override; | 134 void NotifyURLsModified(const URLRows& changed_urls) override; |
134 void NotifyURLsDeleted(bool all_history, | 135 void NotifyURLsDeleted(bool all_history, |
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3750 // Verify that the second term is no longer returned as result, and also check | 3751 // Verify that the second term is no longer returned as result, and also check |
3751 // at the low level that it is gone for good. The term corresponding to the | 3752 // at the low level that it is gone for good. The term corresponding to the |
3752 // first URLRow should not be affected. | 3753 // first URLRow should not be affected. |
3753 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); | 3754 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); |
3754 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); | 3755 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); |
3755 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); | 3756 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); |
3756 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); | 3757 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); |
3757 } | 3758 } |
3758 | 3759 |
3759 } // namespace history | 3760 } // namespace history |
OLD | NEW |