New issue
Advanced search Search tips

Issue 913481 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 859882
issue 883318



Sign in to add a comment

Port LogoServiceImpl and its unittest away from GaiaCookieManagerService to IdentityManager

Project Member Reported by blundell@chromium.org, Dec 10

Issue description

LogoServiceImpl::SigninObserver observes GaiaCookieManagerService. It can instead observe IdentityManager. This change then frees up the unittest to use IdentityTestEnvironment, which eliminates the need for the unittest to know about ProfileOAuth2TokenService.

Marking as P1 as this is necessary to remove the PO2TS dependency from the unittest.
 
Owner: toniki...@chromium.org
Status: Started (was: Available)
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33

commit bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Mon Dec 17 13:30:53 2018

Port LogoServiceImpl and its unittest away from GaiaCookieManagerService to IdentityManager

CL changes LogoServiceImpl::SigninObserver to observes IdentityManager,
not GaiaCookieManagerService. This allows production code to also not
need to reference GCMS.

In the respective unittest, it was updated to use
IdentityTestEnvironment, although references to SigninManager,
GCSM, PO2TS are still present.

BUG= 913481 

Change-Id: I70667d0c6c70231a3240928e145fffa262c60065
Reviewed-on: https://chromium-review.googlesource.com/c/1377969
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#617105}
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/chrome/browser/search_provider_logos/logo_service_factory.cc
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/components/search_provider_logos/BUILD.gn
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/components/search_provider_logos/DEPS
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/components/search_provider_logos/logo_service_impl.cc
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/components/search_provider_logos/logo_service_impl.h
[modify] https://crrev.com/bcae0d3a54157bc4c6f8f8f30a36a4c2acfeab33/components/search_provider_logos/logo_service_impl_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1fb8f9603b6c39c9abac32ca85f38db0ce9e0884

commit 1fb8f9603b6c39c9abac32ca85f38db0ce9e0884
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Tue Dec 18 13:20:38 2018

Make LogoServiceImpl an observer IdentityManager

This CL is a follow up of [1], where it was mentioned that
LogoServiceImpl could inherit from IdentityManager::Observer
directly, rather than having an inner classing doing so.
Marc Treib thinks that the reason was to keep the fact that
we implement this Observer out of the public interface of LogoServiceImpl.
Not sure if that's worth the extra plumbing.

No functionality change is expected.

[1] https://crrev.com/c/1377969/1/components/search_provider_logos/logo_service_impl.cc#181

BUG= 913481 

Change-Id: I6ff30e6f5e2ff2f54c2b39dbca3dd82e3cfd4b0f
Reviewed-on: https://chromium-review.googlesource.com/c/1378990
Reviewed-by: Marc Treib <treib@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#617466}
[modify] https://crrev.com/1fb8f9603b6c39c9abac32ca85f38db0ce9e0884/components/search_provider_logos/logo_service_impl.cc
[modify] https://crrev.com/1fb8f9603b6c39c9abac32ca85f38db0ce9e0884/components/search_provider_logos/logo_service_impl.h
[modify] https://crrev.com/1fb8f9603b6c39c9abac32ca85f38db0ce9e0884/components/search_provider_logos/logo_service_impl_unittest.cc

leaving this open to simplify the way IdentityTestEnvironment are created.

Today it uses the ctor that pass SigninManager, PO2TS, GCMS objects. Once IdentityTestEnvironment gets updated with a ctor that takes a TestURLLoaderFactory, we can switch to using the simpler IdentityTestEnvironment ctor.
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3de64a650cf7afda8b9b97573dadbd315cc58f0f

commit 3de64a650cf7afda8b9b97573dadbd315cc58f0f
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Wed Dec 19 20:30:25 2018

Use the simpler IdentityTestEnvironment ctor in LogoServiceImplTest

After [1], tests can inject a TestURLLoaderFactory instance to be used
by FakeGCMS, via the newly added IdentityTestEnvironment ctor.
This CL makes use of this API to greatly simplify how
IdentityTestEnvironment is instantiated and used in LogoServiceImplTest.

[1] https://crrev.com/c/1384204

BUG= 913481 

Change-Id: I8b63e170f7b4e968d3d58df2237b5c8dcded354c
Reviewed-on: https://chromium-review.googlesource.com/c/1384944
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#617933}
[modify] https://crrev.com/3de64a650cf7afda8b9b97573dadbd315cc58f0f/components/search_provider_logos/logo_service_impl_unittest.cc

Status: Fixed (was: Started)
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6beea3d617ba2a495a7d2501cef69cb64b4c15b5

commit 6beea3d617ba2a495a7d2501cef69cb64b4c15b5
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Thu Dec 20 13:13:56 2018

Remove use of ScopedTaskEnvironment from LogoServiceImplTest's SigninHelper

Calls to ScopedTaskEnvironment.RunUntilIdle are not needed anymore since
SetCookieAccounts() blocks internally until the setting of the cookies
is processed.

This is a follow up of [1], as per blundell's remark.

[1] https://crrev.com/c/1384944/3/components/search_provider_logos/logo_service_impl_unittest.cc#298

BUG= 913481 

Change-Id: Iea2fa36fc73734613c0a30b5d6f4a571750deb86
Reviewed-on: https://chromium-review.googlesource.com/c/1386644
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#618191}
[modify] https://crrev.com/6beea3d617ba2a495a7d2501cef69cb64b4c15b5/components/search_provider_logos/logo_service_impl_unittest.cc

Sign in to add a comment