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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE {} | 96 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE {} |
97 virtual void SetInMemoryBackend( | 97 virtual void SetInMemoryBackend( |
98 scoped_ptr<InMemoryHistoryBackend> backend) OVERRIDE; | 98 scoped_ptr<InMemoryHistoryBackend> backend) OVERRIDE; |
99 virtual void NotifyFaviconChanged(const std::set<GURL>& url) OVERRIDE {} | 99 virtual void NotifyFaviconChanged(const std::set<GURL>& url) OVERRIDE {} |
100 virtual void NotifyURLVisited(ui::PageTransition transition, | 100 virtual void NotifyURLVisited(ui::PageTransition transition, |
101 const URLRow& row, | 101 const URLRow& row, |
102 const RedirectList& redirects, | 102 const RedirectList& redirects, |
103 base::Time visit_time) OVERRIDE {} | 103 base::Time visit_time) OVERRIDE {} |
| 104 virtual void NotifyAddVisit(const BriefVisitInfo& info) OVERRIDE {} |
104 virtual void BroadcastNotifications( | 105 virtual void BroadcastNotifications( |
105 int type, | 106 int type, |
106 scoped_ptr<HistoryDetails> details) OVERRIDE; | 107 scoped_ptr<HistoryDetails> details) OVERRIDE; |
107 virtual void DBLoaded() OVERRIDE {} | 108 virtual void DBLoaded() OVERRIDE {} |
108 virtual void NotifyVisitDBObserversOnAddVisit( | |
109 const BriefVisitInfo& info) OVERRIDE {} | |
110 private: | 109 private: |
111 HistoryBackendDBTest* history_test_; | 110 HistoryBackendDBTest* history_test_; |
112 }; | 111 }; |
113 | 112 |
114 // This must be outside the anonymous namespace for the friend statement in | 113 // This must be outside the anonymous namespace for the friend statement in |
115 // HistoryBackend to work. | 114 // HistoryBackend to work. |
116 class HistoryBackendDBTest : public HistoryUnitTestBase { | 115 class HistoryBackendDBTest : public HistoryUnitTestBase { |
117 public: | 116 public: |
118 HistoryBackendDBTest() : db_(NULL) { | 117 HistoryBackendDBTest() : db_(NULL) { |
119 } | 118 } |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 std::vector<PageUsageData*> results; | 1869 std::vector<PageUsageData*> results; |
1871 db_->QuerySegmentUsage(segment_time, 10, &results); | 1870 db_->QuerySegmentUsage(segment_time, 10, &results); |
1872 ASSERT_EQ(1u, results.size()); | 1871 ASSERT_EQ(1u, results.size()); |
1873 EXPECT_EQ(url, results[0]->GetURL()); | 1872 EXPECT_EQ(url, results[0]->GetURL()); |
1874 EXPECT_EQ(segment_id, results[0]->GetID()); | 1873 EXPECT_EQ(segment_id, results[0]->GetID()); |
1875 EXPECT_EQ(title, results[0]->GetTitle()); | 1874 EXPECT_EQ(title, results[0]->GetTitle()); |
1876 STLDeleteElements(&results); | 1875 STLDeleteElements(&results); |
1877 } | 1876 } |
1878 | 1877 |
1879 } // namespace history | 1878 } // namespace history |
OLD | NEW |