Commit 3953a3f0 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

[s13n] Convert external_provider_impl_chromeos_unittest.cc to IdentityTestEnvironment

BUG=907517

Change-Id: I0d0d73d43ad7af5e2b3cf2091bc45fe782334347
Reviewed-on: https://chromium-review.googlesource.com/c/1349591Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#610912}
parent afecc68c
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#include "chrome/browser/extensions/extension_service_test_base.h" #include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/identity_test_environment_profile_adaptor.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/supervised_user/supervised_user_constants.h" #include "chrome/browser/supervised_user/supervised_user_constants.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
...@@ -31,8 +30,6 @@ ...@@ -31,8 +30,6 @@
#include "chromeos/system/statistics_provider.h" #include "chromeos/system/statistics_provider.h"
#include "components/browser_sync/browser_sync_switches.h" #include "components/browser_sync/browser_sync_switches.h"
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "components/sync/base/pref_names.h" #include "components/sync/base/pref_names.h"
#include "components/sync/model/fake_sync_change_processor.h" #include "components/sync/model/fake_sync_change_processor.h"
#include "components/sync/model/sync_change_processor.h" #include "components/sync/model/sync_change_processor.h"
...@@ -203,12 +200,11 @@ TEST_F(ExternalProviderImplChromeOSTest, DISABLED_PolicyDisabled) { ...@@ -203,12 +200,11 @@ TEST_F(ExternalProviderImplChromeOSTest, DISABLED_PolicyDisabled) {
// Log user in, start sync. // Log user in, start sync.
TestingBrowserProcess::GetGlobal()->SetProfileManager( TestingBrowserProcess::GetGlobal()->SetProfileManager(
new ProfileManagerWithoutInit(temp_dir().GetPath())); new ProfileManagerWithoutInit(temp_dir().GetPath()));
SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(profile_.get()); auto identity_test_env_profile_adaptor =
signin->SetAuthenticatedAccountInfo("gaia-id-test_user@gmail.com", std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile());
"test_user@gmail.com"); identity_test_env_profile_adaptor->identity_test_env()
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get()) ->MakePrimaryAccountAvailable("test_user@gmail.com");
->UpdateCredentials("test_user@gmail.com", "oauth2_login_token");
// App sync will wait for priority sync to complete. // App sync will wait for priority sync to complete.
service_->CheckForExternalUpdates(); service_->CheckForExternalUpdates();
...@@ -231,10 +227,10 @@ TEST_F(ExternalProviderImplChromeOSTest, PriorityCompleted) { ...@@ -231,10 +227,10 @@ TEST_F(ExternalProviderImplChromeOSTest, PriorityCompleted) {
InitServiceWithExternalProviders(true); InitServiceWithExternalProviders(true);
// User is logged in. // User is logged in.
SigninManagerBase* signin = auto identity_test_env_profile_adaptor =
SigninManagerFactory::GetForProfile(profile_.get()); std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile());
signin->SetAuthenticatedAccountInfo("gaia-id-test_user@gmail.com", identity_test_env_profile_adaptor->identity_test_env()->SetPrimaryAccount(
"test_user@gmail.com"); "test_user@gmail.com");
// App sync will wait for priority sync to complete. // App sync will wait for priority sync to complete.
service_->CheckForExternalUpdates(); service_->CheckForExternalUpdates();
......
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