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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // This must be outside the anonymous namespace for the friend statement in | 93 // This must be outside the anonymous namespace for the friend statement in |
94 // HistoryBackendDBTest to work. | 94 // HistoryBackendDBTest to work. |
95 class BackendDelegate : public HistoryBackend::Delegate { | 95 class BackendDelegate : public HistoryBackend::Delegate { |
96 public: | 96 public: |
97 explicit BackendDelegate(HistoryBackendDBTest* history_test) | 97 explicit BackendDelegate(HistoryBackendDBTest* history_test) |
98 : history_test_(history_test) { | 98 : history_test_(history_test) { |
99 } | 99 } |
100 | 100 |
101 void NotifyProfileError(sql::InitStatus init_status) override {} | 101 void NotifyProfileError(sql::InitStatus init_status) override {} |
102 void SetInMemoryBackend(scoped_ptr<InMemoryHistoryBackend> backend) override; | 102 void SetInMemoryBackend(scoped_ptr<InMemoryHistoryBackend> backend) override; |
103 void NotifyAddVisit(const BriefVisitInfo& info) override {} | |
104 void NotifyFaviconChanged(const std::set<GURL>& url) override {} | 103 void NotifyFaviconChanged(const std::set<GURL>& url) override {} |
105 void NotifyURLVisited(ui::PageTransition transition, | 104 void NotifyURLVisited(ui::PageTransition transition, |
106 const URLRow& row, | 105 const URLRow& row, |
107 const RedirectList& redirects, | 106 const RedirectList& redirects, |
108 base::Time visit_time) override {} | 107 base::Time visit_time) override {} |
109 void NotifyURLsModified(const URLRows& changed_urls) override {} | 108 void NotifyURLsModified(const URLRows& changed_urls) override {} |
110 void NotifyURLsDeleted(bool all_history, | 109 void NotifyURLsDeleted(bool all_history, |
111 bool expired, | 110 bool expired, |
112 const URLRows& deleted_rows, | 111 const URLRows& deleted_rows, |
113 const std::set<GURL>& favicon_urls) override {} | 112 const std::set<GURL>& favicon_urls) override {} |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 std::vector<PageUsageData*> results; | 1857 std::vector<PageUsageData*> results; |
1859 db_->QuerySegmentUsage(segment_time, 10, &results); | 1858 db_->QuerySegmentUsage(segment_time, 10, &results); |
1860 ASSERT_EQ(1u, results.size()); | 1859 ASSERT_EQ(1u, results.size()); |
1861 EXPECT_EQ(url, results[0]->GetURL()); | 1860 EXPECT_EQ(url, results[0]->GetURL()); |
1862 EXPECT_EQ(segment_id, results[0]->GetID()); | 1861 EXPECT_EQ(segment_id, results[0]->GetID()); |
1863 EXPECT_EQ(title, results[0]->GetTitle()); | 1862 EXPECT_EQ(title, results[0]->GetTitle()); |
1864 STLDeleteElements(&results); | 1863 STLDeleteElements(&results); |
1865 } | 1864 } |
1866 | 1865 |
1867 } // namespace history | 1866 } // namespace history |
OLD | NEW |