| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 class HistoryBackendTestBase; | 83 class HistoryBackendTestBase; |
| 84 | 84 |
| 85 // This must be a separate object since HistoryBackend manages its lifetime. | 85 // This must be a separate object since HistoryBackend manages its lifetime. |
| 86 // This just forwards the messages we're interested in to the test object. | 86 // This just forwards the messages we're interested in to the test object. |
| 87 class HistoryBackendTestDelegate : public HistoryBackend::Delegate { | 87 class HistoryBackendTestDelegate : public HistoryBackend::Delegate { |
| 88 public: | 88 public: |
| 89 explicit HistoryBackendTestDelegate(HistoryBackendTestBase* test) | 89 explicit HistoryBackendTestDelegate(HistoryBackendTestBase* test) |
| 90 : test_(test) {} | 90 : test_(test) {} |
| 91 | 91 |
| 92 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE {} | 92 virtual void NotifyProfileError(sql::InitStatus init_status) override {} |
| 93 virtual void SetInMemoryBackend( | 93 virtual void SetInMemoryBackend( |
| 94 scoped_ptr<InMemoryHistoryBackend> backend) OVERRIDE; | 94 scoped_ptr<InMemoryHistoryBackend> backend) override; |
| 95 virtual void NotifyFaviconChanged(const std::set<GURL>& urls) OVERRIDE; | 95 virtual void NotifyFaviconChanged(const std::set<GURL>& urls) override; |
| 96 virtual void BroadcastNotifications( | 96 virtual void BroadcastNotifications( |
| 97 int type, | 97 int type, |
| 98 scoped_ptr<HistoryDetails> details) OVERRIDE; | 98 scoped_ptr<HistoryDetails> details) override; |
| 99 virtual void DBLoaded() OVERRIDE; | 99 virtual void DBLoaded() override; |
| 100 virtual void NotifyVisitDBObserversOnAddVisit( | 100 virtual void NotifyVisitDBObserversOnAddVisit( |
| 101 const BriefVisitInfo& info) OVERRIDE {} | 101 const BriefVisitInfo& info) override {} |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 // Not owned by us. | 104 // Not owned by us. |
| 105 HistoryBackendTestBase* test_; | 105 HistoryBackendTestBase* test_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestDelegate); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 class HistoryBackendTestBase : public testing::Test { | 110 class HistoryBackendTestBase : public testing::Test { |
| 111 public: | 111 public: |
| (...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3215 // Verify that the second term is no longer returned as result, and also check | 3215 // Verify that the second term is no longer returned as result, and also check |
| 3216 // at the low level that it is gone for good. The term corresponding to the | 3216 // at the low level that it is gone for good. The term corresponding to the |
| 3217 // first URLRow should not be affected. | 3217 // first URLRow should not be affected. |
| 3218 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); | 3218 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); |
| 3219 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); | 3219 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); |
| 3220 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); | 3220 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); |
| 3221 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); | 3221 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); |
| 3222 } | 3222 } |
| 3223 | 3223 |
| 3224 } // namespace history | 3224 } // namespace history |
| OLD | NEW |