Chromium Code Reviews| 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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1119 | 1120 |
| 1120 class BrowsingDataRemoverTest : public testing::Test { | 1121 class BrowsingDataRemoverTest : public testing::Test { |
| 1121 public: | 1122 public: |
| 1122 BrowsingDataRemoverTest() | 1123 BrowsingDataRemoverTest() |
| 1123 : profile_(new TestingProfile()), | 1124 : profile_(new TestingProfile()), |
| 1124 clear_domain_reliability_tester_(GetProfile()) { | 1125 clear_domain_reliability_tester_(GetProfile()) { |
| 1125 remover_ = | 1126 remover_ = |
| 1126 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); | 1127 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); |
| 1127 | 1128 |
| 1128 #if BUILDFLAG(ANDROID_JAVA_UI) | 1129 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 1129 remover_->OverrideWebappRegistryForTesting( | 1130 static_cast<ChromeBrowsingDataRemoverDelegate*>( |
| 1130 std::unique_ptr<WebappRegistry>(new TestWebappRegistry())); | 1131 remover_->get_embedder_delegate())->OverrideWebappRegistryForTesting( |
| 1132 std::unique_ptr<WebappRegistry>(new TestWebappRegistry())); | |
|
Bernhard Bauer
2016/12/12 14:52:06
Small nit while you're here: Use base::WrapUnique?
msramek
2016/12/12 20:48:56
Done.
| |
| 1131 #endif | 1133 #endif |
| 1132 } | 1134 } |
| 1133 | 1135 |
| 1134 ~BrowsingDataRemoverTest() override {} | 1136 ~BrowsingDataRemoverTest() override {} |
| 1135 | 1137 |
| 1136 void TearDown() override { | 1138 void TearDown() override { |
| 1137 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1139 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1138 mock_policy_ = nullptr; | 1140 mock_policy_ = nullptr; |
| 1139 #endif | 1141 #endif |
| 1140 | 1142 |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3037 EXPECT_TRUE(remover->is_removing()); | 3039 EXPECT_TRUE(remover->is_removing()); |
| 3038 | 3040 |
| 3039 // Add one more deletion and wait for it. | 3041 // Add one more deletion and wait for it. |
| 3040 BlockUntilBrowsingDataRemoved( | 3042 BlockUntilBrowsingDataRemoved( |
| 3041 browsing_data::ALL_TIME, | 3043 browsing_data::ALL_TIME, |
| 3042 BrowsingDataRemover::REMOVE_COOKIES, | 3044 BrowsingDataRemover::REMOVE_COOKIES, |
| 3043 BrowsingDataHelper::UNPROTECTED_WEB); | 3045 BrowsingDataHelper::UNPROTECTED_WEB); |
| 3044 | 3046 |
| 3045 EXPECT_FALSE(remover->is_removing()); | 3047 EXPECT_FALSE(remover->is_removing()); |
| 3046 } | 3048 } |
| OLD | NEW |