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

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

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address final comments Created 5 years, 6 months 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_unittest.cc
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
index 64c04d863c0bf18d1ca63fb05fe8d48f5ca679bd..78328ff0f90b9a592cfd9a4de41ee382ebfc87ed 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
@@ -10,6 +10,7 @@
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/chromeos/policy/device_policy_builder.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
+#include "chrome/browser/chromeos/settings/device_oauth2_token_service_delegate.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
#include "chrome/browser/chromeos/settings/token_encryptor.h"
@@ -128,9 +129,11 @@ class DeviceOAuth2TokenServiceTest : public testing::Test {
}
void CreateService() {
- oauth2_service_.reset(new DeviceOAuth2TokenService(
- request_context_getter_.get(), scoped_testing_local_state_.Get()));
- oauth2_service_->max_refresh_token_validation_retries_ = 0;
+ DeviceOAuth2TokenServiceDelegate* delegate =
+ new DeviceOAuth2TokenServiceDelegate(request_context_getter_.get(),
+ scoped_testing_local_state_.Get());
+ delegate->max_refresh_token_validation_retries_ = 0;
+ oauth2_service_.reset(new DeviceOAuth2TokenService(delegate));
oauth2_service_->set_max_authorization_token_fetch_retries_for_testing(0);
}
@@ -156,8 +159,9 @@ class DeviceOAuth2TokenServiceTest : public testing::Test {
if (!RefreshTokenIsAvailable())
return std::string();
- return oauth2_service_->GetRefreshToken(
- oauth2_service_->GetRobotAccountId());
+ return static_cast<DeviceOAuth2TokenServiceDelegate*>(
+ oauth2_service_->GetDelegate())
+ ->GetRefreshToken(oauth2_service_->GetRobotAccountId());
}
// A utility method to return fake URL results, for testing the refresh token

Powered by Google App Engine
This is Rietveld 408576698