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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #include "net/ssl/ssl_client_cert_type.h" | 92 #include "net/ssl/ssl_client_cert_type.h" |
93 #include "net/url_request/url_request_context.h" | 93 #include "net/url_request/url_request_context.h" |
94 #include "net/url_request/url_request_context_getter.h" | 94 #include "net/url_request/url_request_context_getter.h" |
95 #include "ppapi/features/features.h" | 95 #include "ppapi/features/features.h" |
96 #include "testing/gmock/include/gmock/gmock.h" | 96 #include "testing/gmock/include/gmock/gmock.h" |
97 #include "testing/gtest/include/gtest/gtest.h" | 97 #include "testing/gtest/include/gtest/gtest.h" |
98 #include "third_party/skia/include/core/SkBitmap.h" | 98 #include "third_party/skia/include/core/SkBitmap.h" |
99 #include "ui/gfx/favicon_size.h" | 99 #include "ui/gfx/favicon_size.h" |
100 #include "url/origin.h" | 100 #include "url/origin.h" |
101 | 101 |
102 #if BUILDFLAG(ANDROID_JAVA_UI) | 102 #if defined(OS_ANDROID) |
103 #include "chrome/browser/android/webapps/webapp_registry.h" | 103 #include "chrome/browser/android/webapps/webapp_registry.h" |
104 #endif | 104 #endif |
105 | 105 |
106 #if defined(OS_CHROMEOS) | 106 #if defined(OS_CHROMEOS) |
107 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 107 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
108 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 108 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
109 #include "chrome/browser/chromeos/settings/cros_settings.h" | 109 #include "chrome/browser/chromeos/settings/cros_settings.h" |
110 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 110 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
111 #include "chromeos/dbus/dbus_thread_manager.h" | 111 #include "chromeos/dbus/dbus_thread_manager.h" |
112 #include "chromeos/dbus/mock_cryptohome_client.h" | 112 #include "chromeos/dbus/mock_cryptohome_client.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 private: | 312 private: |
313 void AsyncRunCallback(const base::Closure& callback) { | 313 void AsyncRunCallback(const base::Closure& callback) { |
314 callback.Run(); | 314 callback.Run(); |
315 } | 315 } |
316 | 316 |
317 StoragePartitionRemovalData storage_partition_removal_data_; | 317 StoragePartitionRemovalData storage_partition_removal_data_; |
318 | 318 |
319 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); | 319 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); |
320 }; | 320 }; |
321 | 321 |
322 #if BUILDFLAG(ANDROID_JAVA_UI) | 322 #if defined(OS_ANDROID) |
323 class TestWebappRegistry : public WebappRegistry { | 323 class TestWebappRegistry : public WebappRegistry { |
324 public: | 324 public: |
325 TestWebappRegistry() : WebappRegistry() { } | 325 TestWebappRegistry() : WebappRegistry() { } |
326 | 326 |
327 void UnregisterWebappsForUrls( | 327 void UnregisterWebappsForUrls( |
328 const base::Callback<bool(const GURL&)>& url_filter) override { | 328 const base::Callback<bool(const GURL&)>& url_filter) override { |
329 // Mocks out a JNI call. | 329 // Mocks out a JNI call. |
330 } | 330 } |
331 | 331 |
332 void ClearWebappHistoryForUrls( | 332 void ClearWebappHistoryForUrls( |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 // Test Class ---------------------------------------------------------------- | 1139 // Test Class ---------------------------------------------------------------- |
1140 | 1140 |
1141 class BrowsingDataRemoverTest : public testing::Test { | 1141 class BrowsingDataRemoverTest : public testing::Test { |
1142 public: | 1142 public: |
1143 BrowsingDataRemoverTest() | 1143 BrowsingDataRemoverTest() |
1144 : profile_(new TestingProfile()), | 1144 : profile_(new TestingProfile()), |
1145 clear_domain_reliability_tester_(GetProfile()) { | 1145 clear_domain_reliability_tester_(GetProfile()) { |
1146 remover_ = | 1146 remover_ = |
1147 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); | 1147 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get()); |
1148 | 1148 |
1149 #if BUILDFLAG(ANDROID_JAVA_UI) | 1149 #if defined(OS_ANDROID) |
1150 static_cast<ChromeBrowsingDataRemoverDelegate*>( | 1150 static_cast<ChromeBrowsingDataRemoverDelegate*>( |
1151 remover_->get_embedder_delegate())->OverrideWebappRegistryForTesting( | 1151 remover_->get_embedder_delegate())->OverrideWebappRegistryForTesting( |
1152 base::WrapUnique<WebappRegistry>(new TestWebappRegistry())); | 1152 base::WrapUnique<WebappRegistry>(new TestWebappRegistry())); |
1153 #endif | 1153 #endif |
1154 } | 1154 } |
1155 | 1155 |
1156 ~BrowsingDataRemoverTest() override {} | 1156 ~BrowsingDataRemoverTest() override {} |
1157 | 1157 |
1158 void TearDown() override { | 1158 void TearDown() override { |
1159 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1159 #if BUILDFLAG(ENABLE_EXTENSIONS) |
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3118 // There should be no recently visited bookmarks. | 3118 // There should be no recently visited bookmarks. |
3119 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( | 3119 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( |
3120 bookmark_model, 2, base::Time::UnixEpoch(), | 3120 bookmark_model, 2, base::Time::UnixEpoch(), |
3121 /*consider_visits_from_desktop=*/false), | 3121 /*consider_visits_from_desktop=*/false), |
3122 IsEmpty()); | 3122 IsEmpty()); |
3123 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( | 3123 EXPECT_THAT(ntp_snippets::GetRecentlyVisitedBookmarks( |
3124 bookmark_model, 2, base::Time::UnixEpoch(), | 3124 bookmark_model, 2, base::Time::UnixEpoch(), |
3125 /*consider_visits_from_desktop=*/true), | 3125 /*consider_visits_from_desktop=*/true), |
3126 IsEmpty()); | 3126 IsEmpty()); |
3127 } | 3127 } |
OLD | NEW |