#include "google_apis/gaia/oauth2_mint_access_token_fetcher_adapter.h"
#include <memory>
#include <string>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/gaia/oauth2_mint_token_flow.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
_;
AllOf;
Field;
Ge;
IsEmpty;
Le;
Matcher;
Property;
const char kTestClientId[] = …;
const char kTestClientSecret[] = …;
const char kTestScope[] = …;
const char kTestRefreshToken[] = …;
const char kTestUserGaiaId[] = …;
const char kTestAccessToken[] = …;
const char kTestDeviceId[] = …;
const char kTestVersion[] = …;
const char kTestChannel[] = …;
const char kTestAssertion[] = …;
constexpr char kAssertionSentinel[] = …;
class MockOAuth2AccessTokenConsumer : public OAuth2AccessTokenConsumer { … };
class MockOAuth2MintTokenFlow : public OAuth2MintTokenFlow { … };
Matcher<const OAuth2AccessTokenConsumer::TokenResponse&> HasAccessTokenWithTtl(
const std::string& access_token,
base::TimeDelta time_to_live) { … }
Matcher<const OAuth2MintTokenFlow::Parameters&> ParamsEq(
const OAuth2MintTokenFlow::Parameters& expected) { … }
}
class OAuth2MintAccessTokenFetcherAdapterTest : public testing::Test { … };
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, Params) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, ParamsWithBindingKeyAssertion) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, Success) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, SuccessWithEncryption) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, SuccessDecryptorUnused) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, Failure) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, DecryptionFailure) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, NoDecryptorFailure) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, UnexpectedConsentResult) { … }
TEST_F(OAuth2MintAccessTokenFetcherAdapterTest, CancelRequest) { … }