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 "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
28 #include "base/task/cancelable_task_tracker.h" | 28 #include "base/task/cancelable_task_tracker.h" |
29 #include "base/threading/thread_task_runner_handle.h" | 29 #include "base/threading/thread_task_runner_handle.h" |
30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
31 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 31 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
33 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" | 33 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" |
34 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 34 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
35 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 35 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
36 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" | 36 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" |
| 37 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
37 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 38 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
38 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 39 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
39 #include "chrome/browser/domain_reliability/service_factory.h" | 40 #include "chrome/browser/domain_reliability/service_factory.h" |
40 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 41 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
41 #include "chrome/browser/favicon/favicon_service_factory.h" | 42 #include "chrome/browser/favicon/favicon_service_factory.h" |
42 #include "chrome/browser/history/history_service_factory.h" | 43 #include "chrome/browser/history/history_service_factory.h" |
43 #include "chrome/browser/password_manager/password_store_factory.h" | 44 #include "chrome/browser/password_manager/password_store_factory.h" |
44 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" | 45 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" |
45 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 46 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
46 #include "chrome/browser/storage/durable_storage_permission_context.h" | 47 #include "chrome/browser/storage/durable_storage_permission_context.h" |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 | 1123 |
1123 class BrowsingDataRemoverTest : public testing::Test { | 1124 class BrowsingDataRemoverTest : public testing::Test { |
1124 public: | 1125 public: |
1125 BrowsingDataRemoverTest() | 1126 BrowsingDataRemoverTest() |
1126 : profile_(new TestingProfile()), | 1127 : profile_(new TestingProfile()), |
1127 clear_domain_reliability_tester_(GetProfile()) { | 1128 clear_domain_reliability_tester_(GetProfile()) { |
1128 remover_ = | 1129 remover_ = |
1129 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); | 1130 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); |
1130 | 1131 |
1131 #if BUILDFLAG(ANDROID_JAVA_UI) | 1132 #if BUILDFLAG(ANDROID_JAVA_UI) |
1132 remover_->OverrideWebappRegistryForTesting( | 1133 static_cast<ChromeBrowsingDataRemoverDelegate*>( |
1133 std::unique_ptr<WebappRegistry>(new TestWebappRegistry())); | 1134 remover_->get_embedder_delegate())->OverrideWebappRegistryForTesting( |
| 1135 base::WrapUnique<WebappRegistry>(new TestWebappRegistry())); |
1134 #endif | 1136 #endif |
1135 } | 1137 } |
1136 | 1138 |
1137 ~BrowsingDataRemoverTest() override {} | 1139 ~BrowsingDataRemoverTest() override {} |
1138 | 1140 |
1139 void TearDown() override { | 1141 void TearDown() override { |
1140 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1142 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1141 mock_policy_ = nullptr; | 1143 mock_policy_ = nullptr; |
1142 #endif | 1144 #endif |
1143 | 1145 |
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3093 // There should be no recently visited bookmarks. | 3095 // There should be no recently visited bookmarks. |
3094 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( | 3096 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( |
3095 bookmark_model, 2, base::Time::UnixEpoch(), | 3097 bookmark_model, 2, base::Time::UnixEpoch(), |
3096 /*consider_visits_from_desktop=*/false), | 3098 /*consider_visits_from_desktop=*/false), |
3097 IsEmpty()); | 3099 IsEmpty()); |
3098 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( | 3100 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( |
3099 bookmark_model, 2, base::Time::UnixEpoch(), | 3101 bookmark_model, 2, base::Time::UnixEpoch(), |
3100 /*consider_visits_from_desktop=*/true), | 3102 /*consider_visits_from_desktop=*/true), |
3101 IsEmpty()); | 3103 IsEmpty()); |
3102 } | 3104 } |
OLD | NEW |