| 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 // History unit tests come in two flavors: | 5 // History unit tests come in two flavors: |
| 6 // | 6 // |
| 7 // 1. The more complicated style is that the unit test creates a full history | 7 // 1. The more complicated style is that the unit test creates a full history |
| 8 // service. This spawns a background thread for the history backend, and | 8 // service. This spawns a background thread for the history backend, and |
| 9 // all communication is asynchronous. This is useful for testing more | 9 // all communication is asynchronous. This is useful for testing more |
| 10 // complicated things or end-to-end behavior. | 10 // complicated things or end-to-end behavior. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void NotifyAddVisit(const BriefVisitInfo& info) override {} | 99 void NotifyAddVisit(const BriefVisitInfo& info) override {} |
| 100 void NotifyFaviconChanged(const std::set<GURL>& url) override {} | 100 void NotifyFaviconChanged(const std::set<GURL>& url) override {} |
| 101 void NotifyURLVisited(ui::PageTransition transition, | 101 void NotifyURLVisited(ui::PageTransition transition, |
| 102 const URLRow& row, | 102 const URLRow& row, |
| 103 const RedirectList& redirects, | 103 const RedirectList& redirects, |
| 104 base::Time visit_time) override {} | 104 base::Time visit_time) override {} |
| 105 void NotifyURLsModified(const URLRows& changed_urls) override {} | 105 void NotifyURLsModified(const URLRows& changed_urls) override {} |
| 106 void NotifyKeywordSearchTermUpdated(const URLRow& row, | 106 void NotifyKeywordSearchTermUpdated(const URLRow& row, |
| 107 KeywordID keyword_id, | 107 KeywordID keyword_id, |
| 108 const base::string16& term) override {} | 108 const base::string16& term) override {} |
| 109 void NotifyKeywordSearchTermDeleted(URLID url_id) override {} |
| 109 void BroadcastNotifications(int type, | 110 void BroadcastNotifications(int type, |
| 110 scoped_ptr<HistoryDetails> details) override; | 111 scoped_ptr<HistoryDetails> details) override; |
| 111 void DBLoaded() override {} | 112 void DBLoaded() override {} |
| 112 | 113 |
| 113 private: | 114 private: |
| 114 HistoryBackendDBTest* history_test_; | 115 HistoryBackendDBTest* history_test_; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 // This must be outside the anonymous namespace for the friend statement in | 118 // This must be outside the anonymous namespace for the friend statement in |
| 118 // HistoryBackend to work. | 119 // HistoryBackend to work. |
| (...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 std::vector<PageUsageData*> results; | 1867 std::vector<PageUsageData*> results; |
| 1867 db_->QuerySegmentUsage(segment_time, 10, &results); | 1868 db_->QuerySegmentUsage(segment_time, 10, &results); |
| 1868 ASSERT_EQ(1u, results.size()); | 1869 ASSERT_EQ(1u, results.size()); |
| 1869 EXPECT_EQ(url, results[0]->GetURL()); | 1870 EXPECT_EQ(url, results[0]->GetURL()); |
| 1870 EXPECT_EQ(segment_id, results[0]->GetID()); | 1871 EXPECT_EQ(segment_id, results[0]->GetID()); |
| 1871 EXPECT_EQ(title, results[0]->GetTitle()); | 1872 EXPECT_EQ(title, results[0]->GetTitle()); |
| 1872 STLDeleteElements(&results); | 1873 STLDeleteElements(&results); |
| 1873 } | 1874 } |
| 1874 | 1875 |
| 1875 } // namespace history | 1876 } // namespace history |
| OLD | NEW |