Commit d0dd47ab authored by Lucas Tenório's avatar Lucas Tenório Committed by Commit Bot

Add tests for authenticated Supervision Onboarding pages.

To power the tests we need to setup an HTTP server to handle access
token requests and supervision pages.
It's expected that the Supervision server will return a custom HTTP
header with an specific value when the user is eligible to see the
flow.
We test cases where the server doesn't send the header as well as
when the header doesn't contain the values that we want.

Bug: 958995
Change-Id: Ib8017678951ba9da1ae9b7b5b801c755ee2f7533
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611038Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Lucas Tenório <ltenorio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661083}
parent ec6e7f1c
......@@ -16,7 +16,6 @@ namespace chromeos {
namespace {
constexpr char kGAIAHost[] = "accounts.google.com";
constexpr char kTestAllScopeAccessToken[] = "fake-all-scope-token";
} // namespace
// static
......@@ -26,6 +25,7 @@ const char FakeGaiaMixin::kFakeUserGaiaId[] = "fake-gaiaId";
const char FakeGaiaMixin::kFakeAuthCode[] = "fake-auth-code";
const char FakeGaiaMixin::kFakeRefreshToken[] = "fake-refresh-token";
const char FakeGaiaMixin::kEmptyUserServices[] = "[]";
const char FakeGaiaMixin::kFakeAllScopeAccessToken[] = "fake-all-scope-token";
const char FakeGaiaMixin::kFakeSIDCookie[] = "fake-SID-cookie";
const char FakeGaiaMixin::kFakeLSIDCookie[] = "fake-LSID-cookie";
......@@ -55,7 +55,7 @@ void FakeGaiaMixin::SetupFakeGaiaForLogin(const std::string& user_email,
fake_gaia_->MapEmailToGaiaId(user_email, gaia_id);
FakeGaia::AccessTokenInfo token_info;
token_info.token = kTestAllScopeAccessToken;
token_info.token = kFakeAllScopeAccessToken;
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();
token_info.email = user_email;
token_info.any_scope = true;
......@@ -80,7 +80,7 @@ void FakeGaiaMixin::SetupFakeGaiaForChildUser(const std::string& user_email,
if (issue_any_scope_token) {
FakeGaia::AccessTokenInfo all_scopes_token;
all_scopes_token.token = kTestAllScopeAccessToken;
all_scopes_token.token = kFakeAllScopeAccessToken;
all_scopes_token.audience =
GaiaUrls::GetInstance()->oauth2_chrome_client_id();
all_scopes_token.email = user_email;
......
......@@ -28,6 +28,7 @@ class FakeGaiaMixin : public InProcessBrowserTestMixin {
static const char kFakeAuthCode[];
static const char kFakeRefreshToken[];
static const char kEmptyUserServices[];
static const char kFakeAllScopeAccessToken[];
// FakeGaia is configured to return these cookies for kFakeUserEmail.
static const char kFakeSIDCookie[];
......
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