OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/history/core/browser/typed_url_sync_bridge.h" | 5 #include "components/history/core/browser/typed_url_sync_bridge.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 EXPECT_TRUE(expected.empty()); | 101 EXPECT_TRUE(expected.empty()); |
102 } | 102 } |
103 | 103 |
104 class TestHistoryBackendDelegate : public HistoryBackend::Delegate { | 104 class TestHistoryBackendDelegate : public HistoryBackend::Delegate { |
105 public: | 105 public: |
106 TestHistoryBackendDelegate() {} | 106 TestHistoryBackendDelegate() {} |
107 | 107 |
108 void NotifyProfileError(sql::InitStatus init_status, | 108 void NotifyProfileError(sql::InitStatus init_status, |
109 const std::string& diagnostics) override {} | 109 const std::string& diagnostics) override {} |
110 void SetInMemoryBackend( | 110 void SetInMemoryBackend( |
111 std::unique_ptr<InMemoryHistoryBackend> backend) override{}; | 111 std::unique_ptr<InMemoryHistoryBackend> backend) override {} |
112 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 112 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
113 const GURL& icon_url) override{}; | 113 const GURL& icon_url) override {} |
114 void NotifyURLVisited(ui::PageTransition transition, | 114 void NotifyURLVisited(ui::PageTransition transition, |
115 const URLRow& row, | 115 const URLRow& row, |
116 const RedirectList& redirects, | 116 const RedirectList& redirects, |
117 base::Time visit_time) override{}; | 117 base::Time visit_time) override {} |
118 void NotifyURLsModified(const URLRows& changed_urls) override{}; | 118 void NotifyURLsModified(const URLRows& changed_urls) override {} |
119 void NotifyURLsDeleted(bool all_history, | 119 void NotifyURLsDeleted(bool all_history, |
120 bool expired, | 120 bool expired, |
121 const URLRows& deleted_rows, | 121 const URLRows& deleted_rows, |
122 const std::set<GURL>& favicon_urls) override{}; | 122 const std::set<GURL>& favicon_urls) override {} |
123 void NotifyKeywordSearchTermUpdated(const URLRow& row, | 123 void NotifyKeywordSearchTermUpdated(const URLRow& row, |
124 KeywordID keyword_id, | 124 KeywordID keyword_id, |
125 const base::string16& term) override{}; | 125 const base::string16& term) override {} |
126 void NotifyKeywordSearchTermDeleted(URLID url_id) override{}; | 126 void NotifyKeywordSearchTermDeleted(URLID url_id) override {} |
127 void DBLoaded() override{}; | 127 void DBLoaded() override {} |
128 | 128 |
129 private: | 129 private: |
130 DISALLOW_COPY_AND_ASSIGN(TestHistoryBackendDelegate); | 130 DISALLOW_COPY_AND_ASSIGN(TestHistoryBackendDelegate); |
131 }; | 131 }; |
132 | 132 |
133 class TestHistoryBackend : public HistoryBackend { | 133 class TestHistoryBackend : public HistoryBackend { |
134 public: | 134 public: |
135 TestHistoryBackend() | 135 TestHistoryBackend() |
136 : HistoryBackend(new TestHistoryBackendDelegate(), | 136 : HistoryBackend(new TestHistoryBackendDelegate(), |
137 nullptr, | 137 nullptr, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Create the same data in sync. | 251 // Create the same data in sync. |
252 sync_pb::TypedUrlSpecifics typed_url1, typed_url2; | 252 sync_pb::TypedUrlSpecifics typed_url1, typed_url2; |
253 WriteToTypedUrlSpecifics(row1, visits1, &typed_url1); | 253 WriteToTypedUrlSpecifics(row1, visits1, &typed_url1); |
254 WriteToTypedUrlSpecifics(row2, visits2, &typed_url2); | 254 WriteToTypedUrlSpecifics(row2, visits2, &typed_url2); |
255 | 255 |
256 // Check that the local cache is still correct. | 256 // Check that the local cache is still correct. |
257 VerifyLocalHistoryData({typed_url1, typed_url2}); | 257 VerifyLocalHistoryData({typed_url1, typed_url2}); |
258 } | 258 } |
259 | 259 |
260 } // namespace history | 260 } // namespace history |
OLD | NEW |