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

Unified Diff: chrome/browser/chromeos/login/kiosk_browsertest.cc

Issue 34523003: settings: Make DeviceOAuth2TokenServiceFactory::Get() async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/kiosk_browsertest.cc
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc
index 5e3e9e1ecab315e5575130062785b3df19c77743..c533b0d601b6a5769f77c4ebd54eb34a960c9c12 100644
--- a/chrome/browser/chromeos/login/kiosk_browsertest.cc
+++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -117,6 +117,12 @@ void OnNetworkWaitTimedOut(const base::Closure& runner_quit_task) {
runner_quit_task.Run();
}
+// Helper function for DeviceOAuth2TokenServiceFactory::Get().
+void CopyTokenService(DeviceOAuth2TokenService** out_token_service,
+ DeviceOAuth2TokenService* in_token_service) {
+ *out_token_service = in_token_service;
+}
+
} // namespace
// Fake NetworkChangeNotifier used to simulate network connectivity.
@@ -698,8 +704,12 @@ class KioskEnterpriseTest : public KioskTest {
token_info.token = kTestAccessToken;
token_info.email = kTestEnterpriseServiceAccountId;
fake_gaia_.IssueOAuthToken(kTestRefreshToken, token_info);
- DeviceOAuth2TokenServiceFactory::Get()
- ->SetAndSaveRefreshToken(kTestRefreshToken);
+ DeviceOAuth2TokenService* token_service = NULL;
+ DeviceOAuth2TokenServiceFactory::Get(
+ base::Bind(&CopyTokenService, &token_service));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_TRUE(token_service);
+ token_service->SetAndSaveRefreshToken(kTestRefreshToken);
KioskTest::SetUpOnMainThread();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698