#include "chrome/test/base/fake_gaia_mixin.h"
#include "base/command_line.h"
#include "build/chromeos_buildflags.h"
#include "chrome/test/supervised_user/child_account_test_utils.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_switches.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/test/embedded_test_server/http_response.h"
namespace {
constexpr char kGAIAHost[] = …;
}
const char FakeGaiaMixin::kFakeUserEmail[] = …;
const char FakeGaiaMixin::kFakeUserPassword[] = …;
const char FakeGaiaMixin::kFakeUserGaiaId[] = …;
const char FakeGaiaMixin::kFakeAuthCode[] = …;
const char FakeGaiaMixin::kFakeRefreshToken[] = …;
const char FakeGaiaMixin::kEmptyUserServices[] = …;
const char FakeGaiaMixin::kFakeAllScopeAccessToken[] = …;
const int FakeGaiaMixin::kFakeAccessTokenExpiration = …;
const char FakeGaiaMixin::kFakeSIDCookie[] = …;
const char FakeGaiaMixin::kFakeLSIDCookie[] = …;
const char FakeGaiaMixin::kEnterpriseUser1[] = …;
const char FakeGaiaMixin::kEnterpriseUser1GaiaId[] = …;
const char FakeGaiaMixin::kEnterpriseUser2[] = …;
const char FakeGaiaMixin::kEnterpriseUser2GaiaId[] = …;
const char FakeGaiaMixin::kTestUserinfoToken1[] = …;
const char FakeGaiaMixin::kTestRefreshToken1[] = …;
const char FakeGaiaMixin::kTestUserinfoToken2[] = …;
const char FakeGaiaMixin::kTestRefreshToken2[] = …;
const FakeGaiaMixin::UiPath FakeGaiaMixin::kEmailPath = …;
const FakeGaiaMixin::UiPath FakeGaiaMixin::kPasswordPath = …;
FakeGaiaMixin::FakeGaiaMixin(InProcessBrowserTestMixinHost* host)
: … { … }
FakeGaiaMixin::~FakeGaiaMixin() = default;
void FakeGaiaMixin::SetupFakeGaiaForLogin(const std::string& user_email,
const std::string& gaia_id,
const std::string& refresh_token) { … }
void FakeGaiaMixin::SetupFakeGaiaForLoginWithDefaults() { … }
void FakeGaiaMixin::SetupFakeGaiaForChildUser(const std::string& user_email,
const std::string& gaia_id,
const std::string& refresh_token,
bool issue_any_scope_token) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
void FakeGaiaMixin::SetupFakeGaiaForLoginManager() {
FakeGaia::AccessTokenInfo token_info;
token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
token_info.scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();
token_info.token = kTestUserinfoToken1;
token_info.expires_in = kFakeAccessTokenExpiration;
token_info.email = kEnterpriseUser1;
fake_gaia_->IssueOAuthToken(kTestRefreshToken1, token_info);
token_info.token = kTestUserinfoToken2;
token_info.email = kEnterpriseUser2;
fake_gaia_->IssueOAuthToken(kTestRefreshToken2, token_info);
}
#endif
GURL FakeGaiaMixin::GetFakeGaiaURL(const std::string& relative_url) { … }
void FakeGaiaMixin::SetUp() { … }
void FakeGaiaMixin::SetUpCommandLine(base::CommandLine* command_line) { … }
void FakeGaiaMixin::SetUpOnMainThread() { … }