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

Unified Diff: components/signin/core/browser/child_account_info_fetcher_android.cc

Issue 1353393002: Mask the AccountManager{Future,Callback} with a simple Callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rmcas
Patch Set: fix test. move background task to where it is required. Created 5 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
Index: components/signin/core/browser/child_account_info_fetcher_android.cc
diff --git a/components/signin/core/browser/child_account_info_fetcher_android.cc b/components/signin/core/browser/child_account_info_fetcher_android.cc
index 0c7c59a0a3275c89242067904fa657959dadb44d..132158856ed0217b50e24c221dff74176b426fb6 100644
--- a/components/signin/core/browser/child_account_info_fetcher_android.cc
+++ b/components/signin/core/browser/child_account_info_fetcher_android.cc
@@ -17,6 +17,9 @@ void ChildAccountInfoFetcherAndroid::StartFetchingChildAccountInfo(
JNIEnv* env = base::android::AttachCurrentThread();
std::string account_name =
service->account_tracker_service()->GetAccountInfo(account_id).email;
+ // The AccountTrackerService may not be populated correctly in tests.
+ if (account_name.empty())
+ return;
Java_ChildAccountInfoFetcher_fetch(
env, reinterpret_cast<jlong>(service),
base::android::ConvertUTF8ToJavaString(env, account_id).obj(),

Powered by Google App Engine
This is Rietveld 408576698