| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #endif | 27 #endif |
| 28 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" | 28 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" |
| 29 #include "chrome/browser/history/history_service.h" | 29 #include "chrome/browser/history/history_service.h" |
| 30 #include "chrome/browser/history/history_service_factory.h" | 30 #include "chrome/browser/history/history_service_factory.h" |
| 31 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 31 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 32 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 33 #include "chrome/test/base/testing_browser_process.h" | 33 #include "chrome/test/base/testing_browser_process.h" |
| 34 #include "chrome/test/base/testing_profile.h" | 34 #include "chrome/test/base/testing_profile.h" |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "chromeos/dbus/dbus_thread_manager.h" | 36 #include "chromeos/dbus/dbus_thread_manager.h" |
| 37 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
| 37 #include "chromeos/dbus/mock_cryptohome_client.h" | 38 #include "chromeos/dbus/mock_cryptohome_client.h" |
| 38 #include "chromeos/dbus/mock_dbus_thread_manager.h" | |
| 39 #endif | 39 #endif |
| 40 #include "components/autofill/core/browser/autofill_common_test.h" | 40 #include "components/autofill/core/browser/autofill_common_test.h" |
| 41 #include "components/autofill/core/browser/autofill_profile.h" | 41 #include "components/autofill/core/browser/autofill_profile.h" |
| 42 #include "components/autofill/core/browser/credit_card.h" | 42 #include "components/autofill/core/browser/credit_card.h" |
| 43 #include "components/autofill/core/browser/personal_data_manager.h" | 43 #include "components/autofill/core/browser/personal_data_manager.h" |
| 44 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 44 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
| 45 #include "content/public/browser/dom_storage_context.h" | 45 #include "content/public/browser/dom_storage_context.h" |
| 46 #include "content/public/browser/local_storage_usage_info.h" | 46 #include "content/public/browser/local_storage_usage_info.h" |
| 47 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/storage_partition.h" | 48 #include "content/public/browser/storage_partition.h" |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 #if defined(OS_CHROMEOS) | 1418 #if defined(OS_CHROMEOS) |
| 1419 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { | 1419 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { |
| 1420 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; | 1420 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; |
| 1421 chromeos::ScopedTestCrosSettings test_cros_settings; | 1421 chromeos::ScopedTestCrosSettings test_cros_settings; |
| 1422 chromeos::MockUserManager* mock_user_manager = | 1422 chromeos::MockUserManager* mock_user_manager = |
| 1423 new testing::NiceMock<chromeos::MockUserManager>(); | 1423 new testing::NiceMock<chromeos::MockUserManager>(); |
| 1424 mock_user_manager->SetActiveUser("test@example.com"); | 1424 mock_user_manager->SetActiveUser("test@example.com"); |
| 1425 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); | 1425 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); |
| 1426 chromeos::MockDBusThreadManager mock_dbus_manager; | 1426 |
| 1427 chromeos::DBusThreadManager::InitializeForTesting(&mock_dbus_manager); | 1427 chromeos::FakeDBusThreadManager* fake_dbus_manager = |
| 1428 new chromeos::FakeDBusThreadManager; |
| 1428 chromeos::MockCryptohomeClient* cryptohome_client = | 1429 chromeos::MockCryptohomeClient* cryptohome_client = |
| 1429 mock_dbus_manager.mock_cryptohome_client(); | 1430 new chromeos::MockCryptohomeClient; |
| 1431 fake_dbus_manager->SetCryptohomeClient( |
| 1432 scoped_ptr<chromeos::CryptohomeClient>(cryptohome_client)); |
| 1433 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_manager); |
| 1430 | 1434 |
| 1431 // Expect exactly one call. No calls means no attempt to delete keys and more | 1435 // Expect exactly one call. No calls means no attempt to delete keys and more |
| 1432 // than one call means a significant performance problem. | 1436 // than one call means a significant performance problem. |
| 1433 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) | 1437 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) |
| 1434 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); | 1438 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); |
| 1435 | 1439 |
| 1436 BlockUntilBrowsingDataRemoved( | 1440 BlockUntilBrowsingDataRemoved( |
| 1437 BrowsingDataRemover::EVERYTHING, | 1441 BrowsingDataRemover::EVERYTHING, |
| 1438 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); | 1442 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); |
| 1439 } | 1443 } |
| 1440 #endif | 1444 #endif |
| OLD | NEW |