Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed helper files. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc
index e7d5f328643f264642fe5d85bee8f65acf44ef46..9758cd9a52e85b887b9e10c08c4786bb1df7c5de 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_factory_unittest.cc
@@ -31,9 +31,11 @@ void CopyTokenServiceAndCount(
class ScopedDeviceOAuth2TokenServiceFactorySetUp {
public:
ScopedDeviceOAuth2TokenServiceFactorySetUp()
- : fake_dbus_manager_(new FakeDBusThreadManager) {
- // Take ownership of fake_dbus_manager_.
- DBusThreadManager::InitializeForTesting(fake_dbus_manager_);
+ : fake_cryptohome_client_(new FakeCryptohomeClient) {
+ FakeDBusThreadManager* fake_dbus_manager = new FakeDBusThreadManager;
+ fake_dbus_manager->SetCryptohomeClient(
+ scoped_ptr<CryptohomeClient>(fake_cryptohome_client_));
+ DBusThreadManager::InitializeForTesting(fake_dbus_manager);
SystemSaltGetter::Initialize();
DeviceOAuth2TokenServiceFactory::Initialize();
}
@@ -44,12 +46,12 @@ class ScopedDeviceOAuth2TokenServiceFactorySetUp {
DBusThreadManager::Shutdown();
}
- FakeDBusThreadManager* fake_dbus_manager() {
- return fake_dbus_manager_;
+ FakeCryptohomeClient* fake_cryptohome_client() {
+ return fake_cryptohome_client_;
}
private:
- FakeDBusThreadManager* fake_dbus_manager_;
+ FakeCryptohomeClient* fake_cryptohome_client_;
};
} // namespace
@@ -137,7 +139,7 @@ TEST_F(DeviceOAuth2TokenServiceFactoryTest, Get_MultipleCallers) {
// Test a case where it failed to obtain the system salt.
TEST_F(DeviceOAuth2TokenServiceFactoryTest, Get_NoSystemSalt) {
ScopedDeviceOAuth2TokenServiceFactorySetUp scoped_setup;
- scoped_setup.fake_dbus_manager()->fake_cryptohome_client()->
+ scoped_setup.fake_cryptohome_client()->
set_system_salt(std::vector<uint8>());
DeviceOAuth2TokenService* token_service = NULL;

Powered by Google App Engine
This is Rietveld 408576698