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 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 } | 1566 } |
1567 | 1567 |
1568 #if defined(OS_CHROMEOS) | 1568 #if defined(OS_CHROMEOS) |
1569 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { | 1569 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { |
1570 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; | 1570 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; |
1571 chromeos::ScopedTestCrosSettings test_cros_settings; | 1571 chromeos::ScopedTestCrosSettings test_cros_settings; |
1572 chromeos::MockUserManager* mock_user_manager = | 1572 chromeos::MockUserManager* mock_user_manager = |
1573 new testing::NiceMock<chromeos::MockUserManager>(); | 1573 new testing::NiceMock<chromeos::MockUserManager>(); |
1574 mock_user_manager->SetActiveUser("test@example.com"); | 1574 mock_user_manager->SetActiveUser("test@example.com"); |
1575 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); | 1575 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); |
1576 chromeos::MockDBusThreadManager mock_dbus_manager; | 1576 |
1577 chromeos::DBusThreadManager::InitializeForTesting(&mock_dbus_manager); | 1577 chromeos::FakeDBusThreadManager* fake_dbus_manager = |
| 1578 new chromeos::FakeDBusThreadManager; |
1578 chromeos::MockCryptohomeClient* cryptohome_client = | 1579 chromeos::MockCryptohomeClient* cryptohome_client = |
1579 mock_dbus_manager.mock_cryptohome_client(); | 1580 new chromeos::MockCryptohomeClient; |
| 1581 fake_dbus_manager->SetCryptohomeClient( |
| 1582 scoped_ptr<chromeos::CryptohomeClient>(cryptohome_client)); |
| 1583 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_manager); |
1580 | 1584 |
1581 // Expect exactly one call. No calls means no attempt to delete keys and more | 1585 // Expect exactly one call. No calls means no attempt to delete keys and more |
1582 // than one call means a significant performance problem. | 1586 // than one call means a significant performance problem. |
1583 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) | 1587 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) |
1584 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); | 1588 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); |
1585 | 1589 |
1586 BlockUntilBrowsingDataRemoved( | 1590 BlockUntilBrowsingDataRemoved( |
1587 BrowsingDataRemover::EVERYTHING, | 1591 BrowsingDataRemover::EVERYTHING, |
1588 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); | 1592 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); |
1589 } | 1593 } |
1590 #endif | 1594 #endif |
OLD | NEW |