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" |
81 #include "chromeos/dbus/dbus_thread_manager.h" | 83 #include "chromeos/dbus/dbus_thread_manager.h" |
82 #include "chromeos/dbus/mock_cryptohome_client.h" | 84 #include "chromeos/dbus/mock_cryptohome_client.h" |
83 #include "components/signin/core/account_id/account_id.h" | 85 #include "components/signin/core/account_id/account_id.h" |
84 #endif | 86 #endif |
85 | 87 |
86 #if BUILDFLAG(ENABLE_EXTENSIONS) | 88 #if BUILDFLAG(ENABLE_EXTENSIONS) |
87 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" | 89 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" |
88 #endif | 90 #endif |
89 | 91 |
90 #if BUILDFLAG(ENABLE_PLUGINS) | 92 #if BUILDFLAG(ENABLE_PLUGINS) |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 // Expect the prefs to be cleared when cookies are removed. | 1360 // Expect the prefs to be cleared when cookies are removed. |
1359 EXPECT_TRUE(prefs->GetString(omnibox::kZeroSuggestCachedResults).empty()); | 1361 EXPECT_TRUE(prefs->GetString(omnibox::kZeroSuggestCachedResults).empty()); |
1360 EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_COOKIES, GetRemovalMask()); | 1362 EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_COOKIES, GetRemovalMask()); |
1361 EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, | 1363 EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, |
1362 GetOriginTypeMask()); | 1364 GetOriginTypeMask()); |
1363 } | 1365 } |
1364 | 1366 |
1365 #if defined(OS_CHROMEOS) | 1367 #if defined(OS_CHROMEOS) |
1366 TEST_F(ChromeBrowsingDataRemoverDelegateTest, | 1368 TEST_F(ChromeBrowsingDataRemoverDelegateTest, |
1367 ContentProtectionPlatformKeysRemoval) { | 1369 ContentProtectionPlatformKeysRemoval) { |
| 1370 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; |
| 1371 chromeos::ScopedTestCrosSettings test_cros_settings; |
1368 chromeos::MockUserManager* mock_user_manager = | 1372 chromeos::MockUserManager* mock_user_manager = |
1369 new testing::NiceMock<chromeos::MockUserManager>(); | 1373 new testing::NiceMock<chromeos::MockUserManager>(); |
1370 mock_user_manager->SetActiveUser( | 1374 mock_user_manager->SetActiveUser( |
1371 AccountId::FromUserEmail("test@example.com")); | 1375 AccountId::FromUserEmail("test@example.com")); |
1372 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); | 1376 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); |
1373 | 1377 |
1374 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = | 1378 std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = |
1375 chromeos::DBusThreadManager::GetSetterForTesting(); | 1379 chromeos::DBusThreadManager::GetSetterForTesting(); |
1376 chromeos::MockCryptohomeClient* cryptohome_client = | 1380 chromeos::MockCryptohomeClient* cryptohome_client = |
1377 new chromeos::MockCryptohomeClient; | 1381 new chromeos::MockCryptohomeClient; |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 base::Callback<bool(const GURL&)> origin_filter; | 2320 base::Callback<bool(const GURL&)> origin_filter; |
2317 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); | 2321 tester.GetMockInfo(&remove_count, &data_type_mask, &origin_filter); |
2318 | 2322 |
2319 EXPECT_EQ(1, remove_count); | 2323 EXPECT_EQ(1, remove_count); |
2320 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | | 2324 EXPECT_EQ(net::ReportingBrowsingDataRemover::DATA_TYPE_REPORTS | |
2321 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, | 2325 net::ReportingBrowsingDataRemover::DATA_TYPE_CLIENTS, |
2322 data_type_mask); | 2326 data_type_mask); |
2323 EXPECT_TRUE( | 2327 EXPECT_TRUE( |
2324 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); | 2328 ProbablySameFilters(builder->BuildGeneralFilter(), origin_filter)); |
2325 } | 2329 } |
OLD | NEW |