Commit ad043656 authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[Signin] Live signin test for cancel sync

This CL adds a new LiveSignInTest::CancelSync to the suite of live
signin tests.

The test does the following:
- Starts the signin flow from the settings page
- Enters test account credentials on the login page
- Cancels the sync confirmation dialog
- Checks that Sync is disabled and there are no accounts in Chrome and
on the web

Bug: 1008888
Change-Id: I2480fc7eed0b927048b11894e75e859abb31c917
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946371
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720464}
parent 146b9f1b
......@@ -338,5 +338,33 @@ IN_PROC_BROWSER_TEST_F(LiveSignInTest, CancelSyncWithWebAccount) {
EXPECT_FALSE(identity_manager()->HasPrimaryAccount());
}
// Starts the sign in flow from the settings page, enters credentials on the
// login page but cancels the Sync confirmation dialog. Checks that Sync is
// disabled and no account was added to Chrome.
IN_PROC_BROWSER_TEST_F(LiveSignInTest, CancelSync) {
TestAccount test_account;
CHECK(GetTestAccountsUtil()->GetAccount("TEST_ACCOUNT_1", test_account));
SignInFromSettings(test_account);
TestIdentityManagerObserver observer(identity_manager());
base::RunLoop cookie_update_loop;
observer.SetOnAccountsInCookieUpdatedCallback(
cookie_update_loop.QuitClosure());
SignOutTestObserver sign_out_observer(identity_manager());
login_ui_test_utils::CancelSyncConfirmationDialog(
browser(), base::TimeDelta::FromSeconds(3));
cookie_update_loop.Run();
sign_out_observer.WaitForRefreshTokenRemovedForAccounts(1);
const AccountsInCookieJarInfo& accounts_in_cookie_jar =
identity_manager()->GetAccountsInCookieJar();
EXPECT_TRUE(accounts_in_cookie_jar.accounts_are_fresh);
EXPECT_TRUE(accounts_in_cookie_jar.signed_in_accounts.empty());
EXPECT_TRUE(identity_manager()->GetAccountsWithRefreshTokens().empty());
EXPECT_FALSE(identity_manager()->HasPrimaryAccount());
}
} // namespace test
} // namespace signin
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