Commit 7e47d3c9 authored by chcunningham's avatar chcunningham Committed by Commit Bot

Improve FakeSigninManager::DoSignout() - Check IsAuthenticated

This brings the fake a little closer to real SigninManager. The added
behavior is critical to *upcoming tests for the IdentityMager
ClearPrimaryAccount() (aka signout) API.

*https://chromium-review.googlesource.com/c/chromium/src/+/1154985

Bug: 806781
Change-Id: I4d533e67223dfe4bce6ca26eee7aea6f7cc075fd
Reviewed-on: https://chromium-review.googlesource.com/1160495Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580500}
parent f846b651
......@@ -89,6 +89,22 @@ void FakeSigninManager::DoSignOut(
signin_metrics::ProfileSignout signout_source_metric,
signin_metrics::SignoutDelete signout_delete_metric,
RemoveAccountsOption remove_option) {
if (!IsAuthenticated()) {
if (AuthInProgress()) {
// If the user is in the process of signing in, then treat a call to
// SignOut as a cancellation request.
GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
HandleAuthError(error);
} else {
// Clean up our transient data and exit if we aren't signed in.
// This avoids a perf regression from clearing out the TokenDB if
// SignOut() is invoked on startup to clean up any incomplete previous
// signin attempts.
ClearTransientSigninData();
}
return;
}
if (IsSignoutProhibited())
return;
set_auth_in_progress(std::string());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment