| 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 "chrome/browser/history/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void HistoryBackendTestDelegate::DBLoaded() { | 213 void HistoryBackendTestDelegate::DBLoaded() { |
| 214 test_->loaded_ = true; | 214 test_->loaded_ = true; |
| 215 } | 215 } |
| 216 | 216 |
| 217 class HistoryBackendTest : public HistoryBackendTestBase { | 217 class HistoryBackendTest : public HistoryBackendTestBase { |
| 218 public: | 218 public: |
| 219 HistoryBackendTest() {} | 219 HistoryBackendTest() {} |
| 220 virtual ~HistoryBackendTest() {} | 220 virtual ~HistoryBackendTest() {} |
| 221 | 221 |
| 222 // Callback for QueryMostVisited. | 222 // Callback for QueryMostVisited. |
| 223 void OnQueryMostVisited(CancelableRequestProvider::Handle handle, | 223 void OnQueryMostVisited(history::MostVisitedURLList* data) { |
| 224 history::MostVisitedURLList data) { | 224 most_visited_list_.swap(*data); |
| 225 most_visited_list_.swap(data); | |
| 226 } | 225 } |
| 227 | 226 |
| 228 // Callback for QueryFiltered. | 227 // Callback for QueryFiltered. |
| 229 void OnQueryFiltered(CancelableRequestProvider::Handle handle, | 228 void OnQueryFiltered(CancelableRequestProvider::Handle handle, |
| 230 const history::FilteredURLList& data) { | 229 const history::FilteredURLList& data) { |
| 231 filtered_list_ = data; | 230 filtered_list_ = data; |
| 232 } | 231 } |
| 233 | 232 |
| 234 protected: | 233 protected: |
| 235 const history::MostVisitedURLList& get_most_visited_list() const { | 234 const history::MostVisitedURLList& get_most_visited_list() const { |
| (...skipping 3108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3344 // Verify that the second term is no longer returned as result, and also check | 3343 // Verify that the second term is no longer returned as result, and also check |
| 3345 // at the low level that it is gone for good. The term corresponding to the | 3344 // at the low level that it is gone for good. The term corresponding to the |
| 3346 // first URLRow should not be affected. | 3345 // first URLRow should not be affected. |
| 3347 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); | 3346 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); |
| 3348 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); | 3347 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); |
| 3349 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); | 3348 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); |
| 3350 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); | 3349 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); |
| 3351 } | 3350 } |
| 3352 | 3351 |
| 3353 } // namespace history | 3352 } // namespace history |
| OLD | NEW |