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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
24 #include "base/memory/ref_counted.h" | 24 #include "base/memory/ref_counted.h" |
25 #include "base/metrics/histogram_base.h" | 25 #include "base/metrics/histogram_base.h" |
26 #include "base/metrics/histogram_samples.h" | 26 #include "base/metrics/histogram_samples.h" |
27 #include "base/metrics/statistics_recorder.h" | 27 #include "base/metrics/statistics_recorder.h" |
28 #include "base/run_loop.h" | 28 #include "base/run_loop.h" |
29 #include "base/strings/string16.h" | 29 #include "base/strings/string16.h" |
30 #include "base/strings/string_number_conversions.h" | 30 #include "base/strings/string_number_conversions.h" |
31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
32 #include "base/test/histogram_tester.h" | 32 #include "base/test/histogram_tester.h" |
| 33 #include "base/test/scoped_task_environment.h" |
33 #include "base/threading/thread_task_runner_handle.h" | 34 #include "base/threading/thread_task_runner_handle.h" |
34 #include "build/build_config.h" | 35 #include "build/build_config.h" |
35 #include "components/favicon_base/favicon_usage_data.h" | 36 #include "components/favicon_base/favicon_usage_data.h" |
36 #include "components/history/core/browser/history_backend_client.h" | 37 #include "components/history/core/browser/history_backend_client.h" |
37 #include "components/history/core/browser/history_constants.h" | 38 #include "components/history/core/browser/history_constants.h" |
38 #include "components/history/core/browser/history_database_params.h" | 39 #include "components/history/core/browser/history_database_params.h" |
39 #include "components/history/core/browser/history_service.h" | 40 #include "components/history/core/browser/history_service.h" |
40 #include "components/history/core/browser/history_service_observer.h" | 41 #include "components/history/core/browser/history_service_observer.h" |
41 #include "components/history/core/browser/in_memory_database.h" | 42 #include "components/history/core/browser/in_memory_database.h" |
42 #include "components/history/core/browser/in_memory_history_backend.h" | 43 #include "components/history/core/browser/in_memory_history_backend.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 mem_backend_.swap(backend); | 276 mem_backend_.swap(backend); |
276 } | 277 } |
277 | 278 |
278 // The types and details of notifications which were broadcasted. | 279 // The types and details of notifications which were broadcasted. |
279 std::vector<GURL> favicon_changed_notifications_page_urls_; | 280 std::vector<GURL> favicon_changed_notifications_page_urls_; |
280 std::vector<GURL> favicon_changed_notifications_icon_urls_; | 281 std::vector<GURL> favicon_changed_notifications_icon_urls_; |
281 URLVisitedList url_visited_notifications_; | 282 URLVisitedList url_visited_notifications_; |
282 URLsModifiedList urls_modified_notifications_; | 283 URLsModifiedList urls_modified_notifications_; |
283 URLsDeletedList urls_deleted_notifications_; | 284 URLsDeletedList urls_deleted_notifications_; |
284 | 285 |
285 base::MessageLoop message_loop_; | 286 base::test::ScopedTaskEnvironment scoped_task_environment_; |
286 base::FilePath test_dir_; | 287 base::FilePath test_dir_; |
287 | 288 |
288 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestBase); | 289 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTestBase); |
289 }; | 290 }; |
290 | 291 |
291 void HistoryBackendTestDelegate::SetInMemoryBackend( | 292 void HistoryBackendTestDelegate::SetInMemoryBackend( |
292 std::unique_ptr<InMemoryHistoryBackend> backend) { | 293 std::unique_ptr<InMemoryHistoryBackend> backend) { |
293 test_->SetInMemoryBackend(std::move(backend)); | 294 test_->SetInMemoryBackend(std::move(backend)); |
294 } | 295 } |
295 | 296 |
(...skipping 3626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3922 backend_->QueryMostVisitedURLs(100, 100, &most_visited); | 3923 backend_->QueryMostVisitedURLs(100, 100, &most_visited); |
3923 | 3924 |
3924 const base::string16 kSomeTitle; // Ignored by equality operator. | 3925 const base::string16 kSomeTitle; // Ignored by equality operator. |
3925 EXPECT_THAT( | 3926 EXPECT_THAT( |
3926 most_visited, | 3927 most_visited, |
3927 ElementsAre(MostVisitedURL(GURL("http://example1.com"), kSomeTitle), | 3928 ElementsAre(MostVisitedURL(GURL("http://example1.com"), kSomeTitle), |
3928 MostVisitedURL(GURL("http://example5.com"), kSomeTitle))); | 3929 MostVisitedURL(GURL("http://example5.com"), kSomeTitle))); |
3929 } | 3930 } |
3930 | 3931 |
3931 } // namespace history | 3932 } // namespace history |
OLD | NEW |