Commit 1051e9ee authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

[Android] Fix bookmarks and settings test for master sync decoupling

Two aspects overlooked in crrev.com/c/2309699.
- One test in BookmarkTest also needs to be updated now that the promo
in the bookmarks UI is also shown when DecoupleSyncFromAndroidMasterSync
is enabled.
- In testToggleChromeSyncFromSettings(), if the master sync is not
enabled in the beginning of the test when the feature is enabled, the
waitForLastNotificationCompleted() call after disabling the toggle hangs,
since no notification is triggered when setMasterSyncAutomatically()
doesn't actually change the state of the toggle.

Bug: 1105795
Change-Id: Iaba8da32b99bac16c6103d71f63169453752c969
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312418Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#790822}
parent 9a060864
......@@ -1188,11 +1188,9 @@ public class BookmarkTest {
mBookmarkModel.getOtherFolderId(), 0, TEST_TITLE_A, TEST_URL_A);
});
// Dismiss promo header and simulate a sign in.
mSyncDelegate.setMasterSyncAutomatically(false);
TestThreadUtils.runOnUiThreadBlocking(adapter::simulateSignInForTests);
Assert.assertEquals(
"Expected \"Other Bookmarks\" folder to appear!", 2, adapter.getItemCount());
Assert.assertEquals("Expected promo and \"Other Bookmarks\" folder to appear!", 3,
adapter.getItemCount());
}
@Test
......
......@@ -248,7 +248,8 @@ public class AndroidSyncSettingsTest {
@SmallTest
@Feature({"Sync"})
public void testToggleChromeSyncFromSettings() throws InterruptedException {
setMasterSyncAllowsChromeSync();
mSyncContentResolverDelegate.setMasterSyncAutomatically(true);
mSyncContentResolverDelegate.waitForLastNotificationCompleted();
// First sync
mSyncContentResolverDelegate.setIsSyncable(mAccount, mAuthority, 1);
......
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