Commit a175d38d authored by Lowell Manners's avatar Lowell Manners Committed by Commit Bot

Remove FakeGCMS reference in identity_apitest.cc

FakeGaiaCookieManagerService is being eliminated in favor of setting
expectations using TestURLLoaderFactory.

This is part of step 5 of the plan to eliminate FakeGCMS entirely:
https://docs.google.com/document/d/1t0ZtuV7h-znzdItFgBW0aKPscAwWXIBuNZnNlEGgi7g/edit

Bug: 907782
Change-Id: I8ba1f2a07cceb678d13de68d2e00014b82f4ba1e
Reviewed-on: https://chromium-review.googlesource.com/c/1448189Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Lowell Manners <lowell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628339}
parent f2f0fe87
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_fetcher_service.h" #include "components/signin/core/browser/account_fetcher_service.h"
#include "components/signin/core/browser/account_reconcilor.h" #include "components/signin/core/browser/account_reconcilor.h"
#include "components/signin/core/browser/fake_gaia_cookie_manager_service.h"
#include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/signin_pref_names.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
...@@ -465,7 +464,7 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest { ...@@ -465,7 +464,7 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest {
GaiaCookieManagerServiceFactory::GetInstance()->SetTestingFactory( GaiaCookieManagerServiceFactory::GetInstance()->SetTestingFactory(
context, context,
base::BindRepeating(&BuildFakeGaiaCookieManagerServiceWithURLLoader, base::BindRepeating(&BuildGaiaCookieManagerServiceWithURLLoader,
&test_url_loader_factory_)); &test_url_loader_factory_));
// Ensure that AccountFetcherService is (1) created at all and (2) created // Ensure that AccountFetcherService is (1) created at all and (2) created
...@@ -759,12 +758,7 @@ class GetAuthTokenFunctionTest ...@@ -759,12 +758,7 @@ class GetAuthTokenFunctionTest
void SetUpOnMainThread() override { void SetUpOnMainThread() override {
IdentityTestWithSignin::SetUpOnMainThread(); IdentityTestWithSignin::SetUpOnMainThread();
identity_test_env()->identity_manager()->AddDiagnosticsObserver(this); identity_test_env()->identity_manager()->AddDiagnosticsObserver(this);
signin::SetListAccountsResponseNoAccounts(&test_url_loader_factory_);
FakeGaiaCookieManagerService* fake_gcms =
static_cast<FakeGaiaCookieManagerService*>(
GaiaCookieManagerServiceFactory::GetForProfile(
browser()->profile()));
fake_gcms->SetListAccountsResponseNoAccounts();
} }
void TearDownOnMainThread() override { void TearDownOnMainThread() override {
...@@ -1544,12 +1538,11 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest, ...@@ -1544,12 +1538,11 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
AccountInfo account_info = AccountInfo account_info =
identity_test_env()->MakeAccountAvailable("email@example.com"); identity_test_env()->MakeAccountAvailable("email@example.com");
content::RunAllTasksUntilIdle(); // Flush pending ListAccounts calls. content::RunAllTasksUntilIdle(); // Flush pending ListAccounts calls.
FakeGaiaCookieManagerService* fake_gcms = signin::SetListAccountsResponseOneAccount(
static_cast<FakeGaiaCookieManagerService*>( account_info.email, account_info.gaia, &test_url_loader_factory_);
GaiaCookieManagerServiceFactory::GetForProfile(profile)); GaiaCookieManagerService* gcms =
fake_gcms->SetListAccountsResponseOneAccount(account_info.email, GaiaCookieManagerServiceFactory::GetForProfile(profile);
account_info.gaia); gcms->set_list_accounts_stale_for_testing(true);
fake_gcms->set_list_accounts_stale_for_testing(true);
scoped_refptr<const Extension> extension(CreateExtension(CLIENT_ID | SCOPES)); scoped_refptr<const Extension> extension(CreateExtension(CLIENT_ID | SCOPES));
scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction()); scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
......
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