Commit cd67ef5d authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[Theme sync] Fix flaky integration tests

This CL fixes a few flaky tests for theme sync by using a more careful
process for initial sync setup.

Bug: 956043
Change-Id: Id0d92c87af973fc5ba62e3e4dee29fcf5d1fdf2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1583706Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654450}
parent bb39d917
......@@ -27,7 +27,8 @@ class TwoClientThemesSyncTest : public FeatureToggler, public SyncTest {
: FeatureToggler(switches::kSyncPseudoUSSThemes), SyncTest(TWO_CLIENT) {}
~TwoClientThemesSyncTest() override {}
bool TestUsesSelfNotifications() override { return false; }
// Needed for AwaitQuiescence().
bool TestUsesSelfNotifications() override { return true; }
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest);
......@@ -39,6 +40,8 @@ class TwoClientThemesSyncTest : public FeatureToggler, public SyncTest {
IN_PROC_BROWSER_TEST_P(TwoClientThemesSyncTest,
E2E_ENABLED(DefaultThenSyncCustom)) {
ASSERT_TRUE(SetupSync());
// Wait until sync settles before we override the theme below.
AwaitQuiescence();
ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
......@@ -66,6 +69,8 @@ IN_PROC_BROWSER_TEST_P(TwoClientThemesSyncTest,
SetCustomTheme(GetProfile(1));
ASSERT_TRUE(SetupSync());
// Wait until sync settles before we override the theme below.
AwaitQuiescence();
UseSystemTheme(GetProfile(0));
ASSERT_TRUE(UsingSystemTheme(GetProfile(0)));
......@@ -86,6 +91,8 @@ IN_PROC_BROWSER_TEST_P(TwoClientThemesSyncTest,
SetCustomTheme(GetProfile(1));
ASSERT_TRUE(SetupSync());
// Wait until sync settles before we override the theme below.
AwaitQuiescence();
UseDefaultTheme(GetProfile(0));
EXPECT_TRUE(UsingDefaultTheme(GetProfile(0)));
......@@ -101,6 +108,8 @@ IN_PROC_BROWSER_TEST_P(TwoClientThemesSyncTest,
// is intended to test steady-state scenarios.
IN_PROC_BROWSER_TEST_P(TwoClientThemesSyncTest, E2E_ENABLED(CycleOptions)) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
// Wait until sync settles before we override the theme below.
AwaitQuiescence();
SetCustomTheme(GetProfile(0));
......
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