| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "net/ssl/ssl_client_cert_type.h" | 94 #include "net/ssl/ssl_client_cert_type.h" |
| 95 #include "net/url_request/url_request_context.h" | 95 #include "net/url_request/url_request_context.h" |
| 96 #include "net/url_request/url_request_context_getter.h" | 96 #include "net/url_request/url_request_context_getter.h" |
| 97 #include "ppapi/features/features.h" | 97 #include "ppapi/features/features.h" |
| 98 #include "testing/gmock/include/gmock/gmock.h" | 98 #include "testing/gmock/include/gmock/gmock.h" |
| 99 #include "testing/gtest/include/gtest/gtest.h" | 99 #include "testing/gtest/include/gtest/gtest.h" |
| 100 #include "third_party/skia/include/core/SkBitmap.h" | 100 #include "third_party/skia/include/core/SkBitmap.h" |
| 101 #include "ui/gfx/favicon_size.h" | 101 #include "ui/gfx/favicon_size.h" |
| 102 #include "url/origin.h" | 102 #include "url/origin.h" |
| 103 | 103 |
| 104 #if BUILDFLAG(ANDROID_JAVA_UI) | 104 #if defined(OS_ANDROID) |
| 105 #include "chrome/browser/android/webapps/webapp_registry.h" | 105 #include "chrome/browser/android/webapps/webapp_registry.h" |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 #if defined(OS_CHROMEOS) | 108 #if defined(OS_CHROMEOS) |
| 109 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 109 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
| 110 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 110 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 111 #include "chrome/browser/chromeos/settings/cros_settings.h" | 111 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 112 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 112 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 113 #include "chromeos/dbus/dbus_thread_manager.h" | 113 #include "chromeos/dbus/dbus_thread_manager.h" |
| 114 #include "chromeos/dbus/mock_cryptohome_client.h" | 114 #include "chromeos/dbus/mock_cryptohome_client.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 private: | 316 private: |
| 317 void AsyncRunCallback(const base::Closure& callback) { | 317 void AsyncRunCallback(const base::Closure& callback) { |
| 318 callback.Run(); | 318 callback.Run(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 StoragePartitionRemovalData storage_partition_removal_data_; | 321 StoragePartitionRemovalData storage_partition_removal_data_; |
| 322 | 322 |
| 323 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); | 323 DISALLOW_COPY_AND_ASSIGN(TestStoragePartition); |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 #if BUILDFLAG(ANDROID_JAVA_UI) | 326 #if defined(OS_ANDROID) |
| 327 class TestWebappRegistry : public WebappRegistry { | 327 class TestWebappRegistry : public WebappRegistry { |
| 328 public: | 328 public: |
| 329 TestWebappRegistry() : WebappRegistry() { } | 329 TestWebappRegistry() : WebappRegistry() { } |
| 330 | 330 |
| 331 void UnregisterWebappsForUrls( | 331 void UnregisterWebappsForUrls( |
| 332 const base::Callback<bool(const GURL&)>& url_filter) override { | 332 const base::Callback<bool(const GURL&)>& url_filter) override { |
| 333 // Mocks out a JNI call. | 333 // Mocks out a JNI call. |
| 334 } | 334 } |
| 335 | 335 |
| 336 void ClearWebappHistoryForUrls( | 336 void ClearWebappHistoryForUrls( |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 // Test Class ---------------------------------------------------------------- | 1144 // Test Class ---------------------------------------------------------------- |
| 1145 | 1145 |
| 1146 class BrowsingDataRemoverTest : public testing::Test { | 1146 class BrowsingDataRemoverTest : public testing::Test { |
| 1147 public: | 1147 public: |
| 1148 BrowsingDataRemoverTest() | 1148 BrowsingDataRemoverTest() |
| 1149 : profile_(new TestingProfile()), | 1149 : profile_(new TestingProfile()), |
| 1150 clear_domain_reliability_tester_(GetProfile()) { | 1150 clear_domain_reliability_tester_(GetProfile()) { |
| 1151 remover_ = static_cast<BrowsingDataRemoverImpl*>( | 1151 remover_ = static_cast<BrowsingDataRemoverImpl*>( |
| 1152 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get())); | 1152 BrowsingDataRemoverFactory::GetForBrowserContext(profile_.get())); |
| 1153 | 1153 |
| 1154 #if BUILDFLAG(ANDROID_JAVA_UI) | 1154 #if defined(OS_ANDROID) |
| 1155 static_cast<ChromeBrowsingDataRemoverDelegate*>( | 1155 static_cast<ChromeBrowsingDataRemoverDelegate*>( |
| 1156 remover_->GetEmbedderDelegate())->OverrideWebappRegistryForTesting( | 1156 remover_->GetEmbedderDelegate())->OverrideWebappRegistryForTesting( |
| 1157 base::WrapUnique<WebappRegistry>(new TestWebappRegistry())); | 1157 base::WrapUnique<WebappRegistry>(new TestWebappRegistry())); |
| 1158 #endif | 1158 #endif |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 ~BrowsingDataRemoverTest() override {} | 1161 ~BrowsingDataRemoverTest() override {} |
| 1162 | 1162 |
| 1163 void TearDown() override { | 1163 void TearDown() override { |
| 1164 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1164 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| (...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3129 completion_observer.BlockUntilCompletion(); | 3129 completion_observer.BlockUntilCompletion(); |
| 3130 | 3130 |
| 3131 // There should be only 1 recently visited bookmarks. | 3131 // There should be only 1 recently visited bookmarks. |
| 3132 std::vector<const bookmarks::BookmarkNode*> remaining_nodes = | 3132 std::vector<const bookmarks::BookmarkNode*> remaining_nodes = |
| 3133 ntp_snippets::GetRecentlyVisitedBookmarks( | 3133 ntp_snippets::GetRecentlyVisitedBookmarks( |
| 3134 bookmark_model, 3, base::Time::UnixEpoch(), | 3134 bookmark_model, 3, base::Time::UnixEpoch(), |
| 3135 /*consider_visits_from_desktop=*/true); | 3135 /*consider_visits_from_desktop=*/true); |
| 3136 EXPECT_THAT(remaining_nodes, SizeIs(1)); | 3136 EXPECT_THAT(remaining_nodes, SizeIs(1)); |
| 3137 EXPECT_THAT(remaining_nodes[0]->url().spec(), Eq("http://foo-2.org/")); | 3137 EXPECT_THAT(remaining_nodes[0]->url().spec(), Eq("http://foo-2.org/")); |
| 3138 } | 3138 } |
| OLD | NEW |