Do not FireRefreshTokenAvailable on empty robot account

This CL enforces the constraint that the account_id is not empty in
OAuth2TokenServiceDelegate FireRefreshTokenAvailable,
FireRefreshTokenRevoked and FireAuthErrorChanged. This is in the
interest of adding this semantic constraint to the oauth2_token_service
APIs which is already respected by most callsites.

There is one case that failed on ChromeOS tests (impacting multiple
tests, see first patchset here), in
DeviceOAuth2TokenServiceDelegate::DidGetSystemSalt, where the Robot
account Id might be empty. This is changed to call
FireRefreshTokenAvailable only if the robot account is set.


Bug: 960281
Change-Id: I8cc55cdc0f4c9c15c004c7fb20ed9e221ca1030b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619811
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Auto-Submit: Pâris Meuleman <pmeuleman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#664989}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e1b56df24f89fa74a051579a6368b0887029e448
1 file changed