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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 namespace { | 83 namespace { |
84 | 84 |
85 const char kTestProfileName[] = "test-profile"; | 85 const char kTestProfileName[] = "test-profile"; |
86 | 86 |
87 // Visits with this timestamp are treated as expired. | 87 // Visits with this timestamp are treated as expired. |
88 static const int EXPIRED_VISIT = -1; | 88 static const int EXPIRED_VISIT = -1; |
89 | 89 |
90 class HistoryBackendMock : public HistoryBackend { | 90 class HistoryBackendMock : public HistoryBackend { |
91 public: | 91 public: |
92 HistoryBackendMock() : HistoryBackend(nullptr, nullptr) {} | 92 HistoryBackendMock() : HistoryBackend(nullptr, nullptr) {} |
93 virtual bool IsExpiredVisitTime(const base::Time& time) override { | 93 bool IsExpiredVisitTime(const base::Time& time) override { |
94 return time.ToInternalValue() == EXPIRED_VISIT; | 94 return time.ToInternalValue() == EXPIRED_VISIT; |
95 } | 95 } |
96 MOCK_METHOD1(GetAllTypedURLs, bool(history::URLRows* entries)); | 96 MOCK_METHOD1(GetAllTypedURLs, bool(history::URLRows* entries)); |
97 MOCK_METHOD3(GetMostRecentVisitsForURL, bool(history::URLID id, | 97 MOCK_METHOD3(GetMostRecentVisitsForURL, bool(history::URLID id, |
98 int max_visits, | 98 int max_visits, |
99 history::VisitVector* visits)); | 99 history::VisitVector* visits)); |
100 MOCK_METHOD2(UpdateURL, bool(history::URLID id, const history::URLRow& url)); | 100 MOCK_METHOD2(UpdateURL, bool(history::URLID id, const history::URLRow& url)); |
101 MOCK_METHOD3(AddVisits, bool(const GURL& url, | 101 MOCK_METHOD3(AddVisits, bool(const GURL& url, |
102 const std::vector<history::VisitInfo>& visits, | 102 const std::vector<history::VisitInfo>& visits, |
103 history::VisitSource visit_source)); | 103 history::VisitSource visit_source)); |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 history::URLRows changed_urls; | 1121 history::URLRows changed_urls; |
1122 changed_urls.push_back(updated_url_entry); | 1122 changed_urls.push_back(updated_url_entry); |
1123 SendNotificationURLsModified(changed_urls); | 1123 SendNotificationURLsModified(changed_urls); |
1124 | 1124 |
1125 history::URLRows new_sync_entries; | 1125 history::URLRows new_sync_entries; |
1126 GetTypedUrlsFromSyncDB(&new_sync_entries); | 1126 GetTypedUrlsFromSyncDB(&new_sync_entries); |
1127 | 1127 |
1128 // The change should be ignored. | 1128 // The change should be ignored. |
1129 ASSERT_EQ(0U, new_sync_entries.size()); | 1129 ASSERT_EQ(0U, new_sync_entries.size()); |
1130 } | 1130 } |
OLD | NEW |