Commit aa62da10 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Remove asserts for ChromeSigninController

Removes test asserts verifying ChromeSigninController state where it is
redundant - both SigninFragmentTest and SigninSignoutIntegrationTest
verify ChromeSigninController.isSignedIn after checking
IdentityManager.hasPrimaryAccount, which is now the source of truth for
the sign-in state.

Bug: 1046412
Change-Id: I4ca41bc2c838a37e31a957390efc75cedac4202d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2317212
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791867}
parent 92988347
...@@ -47,7 +47,6 @@ import org.chromium.chrome.test.util.ActivityUtils; ...@@ -47,7 +47,6 @@ import org.chromium.chrome.test.util.ActivityUtils;
import org.chromium.chrome.test.util.ApplicationTestUtils; import org.chromium.chrome.test.util.ApplicationTestUtils;
import org.chromium.chrome.test.util.ChromeRenderTestRule; import org.chromium.chrome.test.util.ChromeRenderTestRule;
import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; import org.chromium.chrome.test.util.browser.sync.SyncTestUtil;
import org.chromium.components.signin.ChromeSigninController;
import org.chromium.components.signin.metrics.SigninAccessPoint; import org.chromium.components.signin.metrics.SigninAccessPoint;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
...@@ -164,8 +163,6 @@ public class SigninFragmentTest { ...@@ -164,8 +163,6 @@ public class SigninFragmentTest {
.getIdentityManager() .getIdentityManager()
.hasPrimaryAccount(); .hasPrimaryAccount();
}, CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL, CriteriaHelper.DEFAULT_POLLING_INTERVAL); }, CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL, CriteriaHelper.DEFAULT_POLLING_INTERVAL);
// TODO(https://crbug.com/1041815): Usage of ChromeSigninController should be removed later
Assert.assertTrue(ChromeSigninController.get().isSignedIn());
Assert.assertTrue(SyncTestUtil.isSyncRequested()); Assert.assertTrue(SyncTestUtil.isSyncRequested());
TestThreadUtils.runOnUiThreadBlocking( TestThreadUtils.runOnUiThreadBlocking(
() -> { Assert.assertFalse(ProfileSyncService.get().isFirstSetupComplete()); }); () -> { Assert.assertFalse(ProfileSyncService.get().isFirstSetupComplete()); });
......
...@@ -45,7 +45,6 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; ...@@ -45,7 +45,6 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.ActivityUtils; import org.chromium.chrome.test.util.ActivityUtils;
import org.chromium.chrome.test.util.BookmarkTestUtil; import org.chromium.chrome.test.util.BookmarkTestUtil;
import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule; import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule;
import org.chromium.components.signin.ChromeSigninController;
import org.chromium.components.signin.GAIAServiceType; import org.chromium.components.signin.GAIAServiceType;
import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.signin.identitymanager.ConsentLevel;
import org.chromium.components.signin.metrics.SigninAccessPoint; import org.chromium.components.signin.metrics.SigninAccessPoint;
...@@ -229,8 +228,6 @@ public class SigninSignoutIntegrationTest { ...@@ -229,8 +228,6 @@ public class SigninSignoutIntegrationTest {
TestThreadUtils.runOnUiThreadBlocking( TestThreadUtils.runOnUiThreadBlocking(
() -> { mSigninManager.signIn(SigninAccessPoint.SETTINGS, account, null); }); () -> { mSigninManager.signIn(SigninAccessPoint.SETTINGS, account, null); });
assertSignedIn(); assertSignedIn();
// TODO(https://crbug.com/1041815): Usage of ChromeSigninController should be removed later
Assert.assertTrue(ChromeSigninController.get().isSignedIn());
} }
private void assertSignedIn() { private void assertSignedIn() {
......
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