| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "net/url_request/url_request_context_getter.h" | 52 #include "net/url_request/url_request_context_getter.h" |
| 53 #include "testing/gmock/include/gmock/gmock.h" | 53 #include "testing/gmock/include/gmock/gmock.h" |
| 54 #include "testing/gtest/include/gtest/gtest.h" | 54 #include "testing/gtest/include/gtest/gtest.h" |
| 55 | 55 |
| 56 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
| 57 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 57 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
| 58 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 58 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 59 #include "chrome/browser/chromeos/settings/cros_settings.h" | 59 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 60 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 60 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 61 #include "chromeos/dbus/dbus_thread_manager.h" | 61 #include "chromeos/dbus/dbus_thread_manager.h" |
| 62 #include "chromeos/dbus/fake_dbus_thread_manager.h" | |
| 63 #include "chromeos/dbus/mock_cryptohome_client.h" | 62 #include "chromeos/dbus/mock_cryptohome_client.h" |
| 64 #endif | 63 #endif |
| 65 | 64 |
| 66 #if defined(ENABLE_EXTENSIONS) | 65 #if defined(ENABLE_EXTENSIONS) |
| 67 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" | 66 #include "chrome/browser/extensions/mock_extension_special_storage_policy.h" |
| 68 #endif | 67 #endif |
| 69 | 68 |
| 70 class MockExtensionSpecialStoragePolicy; | 69 class MockExtensionSpecialStoragePolicy; |
| 71 | 70 |
| 72 using content::BrowserThread; | 71 using content::BrowserThread; |
| (...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 | 1757 |
| 1759 #if defined(OS_CHROMEOS) | 1758 #if defined(OS_CHROMEOS) |
| 1760 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { | 1759 TEST_F(BrowsingDataRemoverTest, ContentProtectionPlatformKeysRemoval) { |
| 1761 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; | 1760 chromeos::ScopedTestDeviceSettingsService test_device_settings_service; |
| 1762 chromeos::ScopedTestCrosSettings test_cros_settings; | 1761 chromeos::ScopedTestCrosSettings test_cros_settings; |
| 1763 chromeos::MockUserManager* mock_user_manager = | 1762 chromeos::MockUserManager* mock_user_manager = |
| 1764 new testing::NiceMock<chromeos::MockUserManager>(); | 1763 new testing::NiceMock<chromeos::MockUserManager>(); |
| 1765 mock_user_manager->SetActiveUser("test@example.com"); | 1764 mock_user_manager->SetActiveUser("test@example.com"); |
| 1766 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); | 1765 chromeos::ScopedUserManagerEnabler user_manager_enabler(mock_user_manager); |
| 1767 | 1766 |
| 1768 chromeos::FakeDBusThreadManager* fake_dbus_manager = | 1767 scoped_ptr<chromeos::DBusThreadManagerSetter> dbus_setter = |
| 1769 new chromeos::FakeDBusThreadManager; | 1768 chromeos::DBusThreadManager::GetSetterForTesting(); |
| 1770 chromeos::MockCryptohomeClient* cryptohome_client = | 1769 chromeos::MockCryptohomeClient* cryptohome_client = |
| 1771 new chromeos::MockCryptohomeClient; | 1770 new chromeos::MockCryptohomeClient; |
| 1772 fake_dbus_manager->SetCryptohomeClient( | 1771 dbus_setter->SetCryptohomeClient( |
| 1773 scoped_ptr<chromeos::CryptohomeClient>(cryptohome_client)); | 1772 scoped_ptr<chromeos::CryptohomeClient>(cryptohome_client)); |
| 1774 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_manager); | |
| 1775 | 1773 |
| 1776 // Expect exactly one call. No calls means no attempt to delete keys and more | 1774 // Expect exactly one call. No calls means no attempt to delete keys and more |
| 1777 // than one call means a significant performance problem. | 1775 // than one call means a significant performance problem. |
| 1778 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) | 1776 EXPECT_CALL(*cryptohome_client, TpmAttestationDeleteKeys(_, _, _, _)) |
| 1779 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); | 1777 .WillOnce(WithArgs<3>(Invoke(FakeDBusCall))); |
| 1780 | 1778 |
| 1781 BlockUntilBrowsingDataRemoved( | 1779 BlockUntilBrowsingDataRemoved( |
| 1782 BrowsingDataRemover::EVERYTHING, | 1780 BrowsingDataRemover::EVERYTHING, |
| 1783 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); | 1781 BrowsingDataRemover::REMOVE_CONTENT_LICENSES, false); |
| 1784 | 1782 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 EXPECT_EQ(1u, tester.clear_count()); | 1830 EXPECT_EQ(1u, tester.clear_count()); |
| 1833 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); | 1831 EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); |
| 1834 } | 1832 } |
| 1835 | 1833 |
| 1836 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { | 1834 TEST_F(BrowsingDataRemoverTest, DomainReliability_NoMonitor) { |
| 1837 BlockUntilBrowsingDataRemoved( | 1835 BlockUntilBrowsingDataRemoved( |
| 1838 BrowsingDataRemover::EVERYTHING, | 1836 BrowsingDataRemover::EVERYTHING, |
| 1839 BrowsingDataRemover::REMOVE_HISTORY | | 1837 BrowsingDataRemover::REMOVE_HISTORY | |
| 1840 BrowsingDataRemover::REMOVE_COOKIES, false); | 1838 BrowsingDataRemover::REMOVE_COOKIES, false); |
| 1841 } | 1839 } |
| OLD | NEW |