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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 virtual void NotifyProfileError(int backend_id, | 89 virtual void NotifyProfileError(int backend_id, |
90 sql::InitStatus init_status) OVERRIDE {} | 90 sql::InitStatus init_status) OVERRIDE {} |
91 virtual void SetInMemoryBackend(int backend_id, | 91 virtual void SetInMemoryBackend(int backend_id, |
92 InMemoryHistoryBackend* backend) OVERRIDE; | 92 InMemoryHistoryBackend* backend) OVERRIDE; |
93 virtual void BroadcastNotifications(int type, | 93 virtual void BroadcastNotifications(int type, |
94 HistoryDetails* details) OVERRIDE; | 94 HistoryDetails* details) OVERRIDE; |
95 virtual void DBLoaded(int backend_id) OVERRIDE {} | 95 virtual void DBLoaded(int backend_id) OVERRIDE {} |
96 virtual void StartTopSitesMigration(int backend_id) OVERRIDE {} | 96 virtual void StartTopSitesMigration(int backend_id) OVERRIDE {} |
| 97 virtual void NotifyVisitDBObserversOnAddVisit( |
| 98 const BriefVisitInfo& info) OVERRIDE {} |
97 private: | 99 private: |
98 HistoryTest* history_test_; | 100 HistoryTest* history_test_; |
99 }; | 101 }; |
100 | 102 |
101 // This must be outside the anonymous namespace for the friend statement in | 103 // This must be outside the anonymous namespace for the friend statement in |
102 // HistoryBackend to work. | 104 // HistoryBackend to work. |
103 class HistoryTest : public testing::Test { | 105 class HistoryTest : public testing::Test { |
104 public: | 106 public: |
105 HistoryTest() | 107 HistoryTest() |
106 : history_service_(NULL), | 108 : history_service_(NULL), |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 history_service_ = history; | 956 history_service_ = history; |
955 history->ScheduleDBTask(task.get(), &request_consumer); | 957 history->ScheduleDBTask(task.get(), &request_consumer); |
956 request_consumer.CancelAllRequests(); | 958 request_consumer.CancelAllRequests(); |
957 CleanupHistoryService(); | 959 CleanupHistoryService(); |
958 // WARNING: history has now been deleted. | 960 // WARNING: history has now been deleted. |
959 history = NULL; | 961 history = NULL; |
960 ASSERT_FALSE(task->done_invoked); | 962 ASSERT_FALSE(task->done_invoked); |
961 } | 963 } |
962 | 964 |
963 } // namespace history | 965 } // namespace history |
OLD | NEW |