New issue
Advanced search Search tips

Issue 890789 link

Starred by 3 users

Issue metadata

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

Blocked on:
issue 889902

Blocking:
issue 883318
issue 883330



Sign in to add a comment

Convert chrome/browser/signin/dice_browsertest.cc to IdentityManager

Project Member Reported by sdefresne@chromium.org, Oct 1

Issue description

API used:
- SigninManager::GetAccountIdForAuthInProgress()
- SigninManager::SignOut()
- SigninManager::StartSignInWithRefreshToken()
- SigninManager::AuthInProgress()

 
Blocking: 883318
As part of this work, we should port the usage of ProfileOAuth2TokenService as well. The only non-straightforward conversion is the usage of the delegate to check that the refresh token is the invalid token. We can see if the test OWNERS if that check is important to preserve; if so, we can add a test API for it.
Labels: Proj-Servicification-VendorBug
Cc: droger@chromium.org
Owner: toniki...@chromium.org
Status: Started (was: Available)
(re: The only non-straightforward conversion is the usage of the delegate to check that the refresh token is the invalid token)

 730   EXPECT_TRUE(GetTokenService()->RefreshTokenHasError(GetMainAccountID()));
 731   EXPECT_EQ(MutableProfileOAuth2TokenServiceDelegate::kInvalidRefreshToken,
 732             delegate->GetRefreshTokenForTest(GetMainAccountID()));

(...)


As Colin mentioned in comment #1, I will add a testing API for this.


PS: I lean toward to think that both lines 730 and 731-732 test the same thing, and the latter could be omitted. /cc David, in case he has thoughts.
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 19

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

commit 1f535375675f3638137f67352b773cf6912343b9
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Wed Dec 19 19:32:46 2018

[s13n] Convert c/b/signin/dice_browsertest.cc to IdentityManager

SigninManager and PO2TS are going to be an implementation detail
of the IdentityManager, and eventually will not be exposed to clients
out of //services/identity.
This CL converts DiceBrowserTestBase and its subclasses accordingly.

Two remarks:

1) The conversion assumes that the actual |refresh_token| an account
holds to authenticate is an implementation detail of Identity service.
Prior to this CL, the tests used to set an specific refresh_token value
(eg. "other_token"), and later compared whether the account held this
specific token.
Now the identity utils methods hide the actual refresh_token set
(see identity::MakeAccountAvailable) to an account, and rely on
checking whether the authentication was successfully or not instead.

2) It adds a new API to AccountsMutator, AreAllCredentialsLoaded,
which calls out to the respective PO2TS method.

BUG= 890789 

Change-Id: Id0e5e36b55dc1f9f8b1ab088833b08fdff58a9c5
Reviewed-on: https://chromium-review.googlesource.com/c/1383152
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617910}
[modify] https://crrev.com/1f535375675f3638137f67352b773cf6912343b9/chrome/browser/signin/dice_browsertest.cc
[modify] https://crrev.com/1f535375675f3638137f67352b773cf6912343b9/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/1f535375675f3638137f67352b773cf6912343b9/services/identity/public/cpp/identity_test_utils.cc
[modify] https://crrev.com/1f535375675f3638137f67352b773cf6912343b9/services/identity/public/cpp/identity_test_utils.h

Status: Fixed (was: Started)
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 21

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

commit 9f76a7a36d68d8a075f71f405feb0388806d308c
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Fri Dec 21 11:40:30 2018

Use non-legacy signin method in DiceBrowserTestBase::SetupSignedInAccounts

It turns out that identity::MakePrimaryAccountAvaialble
replaces the legacy
PrimaryAccountMutator::LegacyStartSigninWithRefreshTokenForPrimaryAccount
method in the context of  DiceBrowserTestBase::SetupSignedInAccounts
(dice_browsertest.cc) just fine.

CL is a follow up of [1], as per droger's remark.

[1] https://crrev.com/c/1383152/1/chrome/browser/signin/dice_browsertest.cc#397

BUG= 890789 

Change-Id: I8767d739b137b1638737e8a65b4006374ffe98f3
Reviewed-on: https://chromium-review.googlesource.com/c/1386645
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#618502}
[modify] https://crrev.com/9f76a7a36d68d8a075f71f405feb0388806d308c/chrome/browser/signin/dice_browsertest.cc

Cc: ma...@igalia.com sdefresne@chromium.org
 Issue 896698  has been merged into this issue.

Sign in to add a comment