#include "google_apis/gaia/oauth2_access_token_manager.h"
#include <memory>
#include "base/containers/contains.h"
#include "base/memory/ref_counted.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "google_apis/gaia/gaia_access_token_fetcher.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/gaia/oauth2_access_token_fetcher_impl.h"
#include "google_apis/gaia/oauth2_access_token_manager_test_util.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
constexpr char kTestAccountId[] = …;
class FakeOAuth2AccessTokenManagerDelegate
: public OAuth2AccessTokenManager::Delegate { … };
class FakeOAuth2AccessTokenManagerConsumer
: public TestingOAuth2AccessTokenManagerConsumer { … };
class DiagnosticsObserverForTesting
: public OAuth2AccessTokenManager::DiagnosticsObserver { … };
}
class OAuth2AccessTokenManagerTest : public testing::Test { … };
TEST_F(OAuth2AccessTokenManagerTest, StartRequest) { … }
TEST_F(OAuth2AccessTokenManagerTest, CancelAllRequests) { … }
TEST_F(OAuth2AccessTokenManagerTest, CancelRequestsForAccount) { … }
TEST_F(OAuth2AccessTokenManagerTest, ClearCache) { … }
TEST_F(OAuth2AccessTokenManagerTest, ClearCacheForAccount) { … }
TEST_F(OAuth2AccessTokenManagerTest, HandleAccessTokenFetch) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenInvalidated) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenFetchedOnRequestCanceled) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenFetchedOnRequestCompleted) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenFetchedCancelsRequests) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenRequested) { … }
TEST_F(OAuth2AccessTokenManagerTest,
OnFetchAccessTokenCompleteOnRequestCompleted) { … }
TEST_F(OAuth2AccessTokenManagerTest,
OnFetchAccessTokenCompleteOnRequestWithoutRefreshToken) { … }
TEST_F(OAuth2AccessTokenManagerTest, OnAccessTokenRemoved) { … }