OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chrome_browsing_data_remover_delegate.h" | 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "third_party/skia/include/core/SkBitmap.h" | 71 #include "third_party/skia/include/core/SkBitmap.h" |
72 #include "ui/gfx/favicon_size.h" | 72 #include "ui/gfx/favicon_size.h" |
73 | 73 |
74 #if defined(OS_ANDROID) | 74 #if defined(OS_ANDROID) |
75 #include "chrome/browser/android/webapps/webapp_registry.h" | 75 #include "chrome/browser/android/webapps/webapp_registry.h" |
76 #endif | 76 #endif |
77 | 77 |
78 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
79 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 79 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
80 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 80 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
81 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
82 #include "chrome/browser/chromeos/settings/device_settings_service.h" | |
83 #include "chromeos/dbus/dbus_thread_manager.h" | 81 #include "chromeos/dbus/dbus_thread_manager.h" |
84 #include "chromeos/dbus/mock_cryptohome_client.h" | 82 #include "chromeos/dbus/mock_cryptohome_client.h" |
85 #include "components/signin/core/account_id/account_id.h" | 83 #include "components/signin/core/account_id/account_id.h" |
86 #endif | 84 #endif |
87 | 85 |
88 #if BUILDFLAG(ENABLE_EXTENSIONS) | 86 #if BUILDFLAG(ENABLE_EXTENSIONS) |
89 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" | 87 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" |
90 #endif | 88 #endif |
91 | 89 |
92 #if BUILDFLAG(ENABLE_PLUGINS) | 90 #if BUILDFLAG(ENABLE_PLUGINS) |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 // Expect the prefs to be cleared when cookies are removed. | 1358 // Expect the prefs to be cleared when cookies are removed. |
1361 EXPECT_TRUE(prefs->GetString(omnibox::kZeroSuggestCachedResults).empty()); | 1359 EXPECT_TRUE(prefs->GetString(omnibox::kZeroSuggestCachedResults).empty()); |
1362 EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_COOKIES, GetRemovalMask()); | 1360 EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_COOKIES, GetRemovalMask()); |
1363 EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, | 1361 EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, |
1364 GetOriginTypeMask()); | 1362 GetOriginTypeMask()); |
1365 } | 1363 } |
1366 | 1364 |
1367 #if defined(OS_CHROMEOS) | 1365 #if defined(OS_CHROMEOS) |
1368 TEST_F(ChromeBrowsingDataRemoverDelegateTest, | 1366 TEST_F(ChromeBrowsingDataRemoverDelegateTest, |
1369 ContentProtectionPlatformKeysRemoval) { | 1367 ContentProtectionPlatformKeysRemoval) { |
1370 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; | |
1371 chromeos::ScopedTestCrosSettings test_cros_settings; | |
1372 chromeos::MockUserManager* mock_user_manager = | 1368 chromeos::MockUserManager* mock_user_manager = |
1373 new testing::NiceMock<chromeos::MockUserManager>(); | 1369 new testing::NiceMock<chromeos::MockUserManager>(); |
1374 mock_user_manager->SetActiveUser( | 1370 mock_user_manager->SetActiveUser( |
1375 AccountId::FromUserEmail("test@example.com")); | 1371 AccountId::FromUserEmail("test@example.com")); |
1376 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); | 1372 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); |
1377 | 1373 |
1378 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = | 1374 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = |
1379 chromeos::DBusThreadManager::GetSetterForTesting(); | 1375 chromeos::DBusThreadManager::GetSetterForTesting(); |
1380 chromeos::MockCryptohomeClient* cryptohome_client = | 1376 chromeos::MockCryptohomeClient* cryptohome_client = |
1381 new chromeos::MockCryptohomeClient; | 1377 new chromeos::MockCryptohomeClient; |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 base::Callback<bool(const GURL&)> origin_filter; | 2316 base::Callback<bool(const GURL&)> origin_filter; |
2321 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); | 2317 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); |
2322 | 2318 |
2323 EXPECT_EQ(1, remove_count); | 2319 EXPECT_EQ(1, remove_count); |
2324 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | | 2320 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | |
2325 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, | 2321 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, |
2326 data_type_mask); | 2322 data_type_mask); |
2327 EXPECT_TRUE( | 2323 EXPECT_TRUE( |
2328 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); | 2324 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); |
2329 } | 2325 } |
OLD | NEW |