Provide a IdentityTestEnvinroment ctor that takes a PrefService |
|||
Issue descriptionThe ctor would still supply the internal dependencies, but the tests could tweak the PrefService instance they hold. Other objects, eg PO2TS, SigninManager, AccountTrackerService would be hidden from the tests.
,
Nov 27
So somes alternative APIS: 1_ extend the existing constructor that takes the optional bool parameter to take an also optional PrefService instance, and adapt IdentityManagerDependenciesOwner accordingly. 2_ add a new constructor that takes PrefService instance and the optional bool parameter, and adapt IdentityManagerDependenciesOwner accordingly. 3_ keep the constructors as is, and add a getter to IdentityTestEnvironment for the PrefService Colin, WDYT?
,
Nov 28
Let's do 1. Thanks!
,
Nov 28
,
Nov 28
Ok, I am actively working on it.
,
Nov 29
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5c70ec8578d5785c2268c6531b1b049d0c3bb780 commit 5c70ec8578d5785c2268c6531b1b049d0c3bb780 Author: Antonio Gomes <tonikitoo@igalia.com> Date: Thu Nov 29 14:09:25 2018 Provide a IdentityTestEnvinroment ctor that takes a PrefService This CL extends the existing simple IdentityTestEnvinroment ctor by supplying an optional TestingPrefServiceSyncable instance. This way tests could still tweak the PrefService instance they hold and other objects, eg PO2TS, SigninManager, AccountTrackerService would be hidden from the tests. BUG= 908810 Change-Id: If8257ddc6bdc22481d3530197025592264ffe256 Reviewed-on: https://chromium-review.googlesource.com/c/1351160 Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> Reviewed-by: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#612181} [modify] https://crrev.com/5c70ec8578d5785c2268c6531b1b049d0c3bb780/services/identity/public/cpp/identity_test_environment.cc [modify] https://crrev.com/5c70ec8578d5785c2268c6531b1b049d0c3bb780/services/identity/public/cpp/identity_test_environment.h
,
Nov 29
,
Dec 11
one of the possible users of this API might require a bit more refinement:
AccountReconcilorTest::AccountReconcilorTest()
: account_consistency_(signin::AccountConsistencyMethod::kDisabled),
test_signin_client_(&pref_service_),
token_service_(&pref_service_),
cookie_manager_service_(&token_service_,
&test_signin_client_),
#if defined(OS_CHROMEOS)
signin_manager_(&test_signin_client_, &account_tracker_),
#else
signin_manager_(&test_signin_client_,
&token_service_,
&account_tracker_,
&cookie_manager_service_),
#endif
identity_test_env_(&account_tracker_,
&token_service_,
&signin_manager_,
&cookie_manager_service_) {
AccountTrackerService::RegisterPrefs(pref_service_.registry());
ProfileOAuth2TokenService::RegisterProfilePrefs(pref_service_.registry());
SigninManagerBase::RegisterProfilePrefs(pref_service_.registry());
SigninManagerBase::RegisterPrefs(pref_service_.registry());
pref_service_.registry()->RegisterBooleanPref(
prefs::kTokenServiceDiceCompatible, false);
account_tracker_.Initialize(&pref_service_, base::FilePath());
cookie_manager_service_.SetListAccountsResponseHttpNotFound();
The call to SetListAccountsResponseHttpNotFound ^^^ can not be achieved as is
if we use the IdentityTestEnvironment ctor provided by this CL.
,
Dec 12
Sorry, can you be more specific as to the problem? |
|||
►
Sign in to add a comment |
|||
Comment 1 by toniki...@chromium.org
, Nov 27