#include "base/strings/stringprintf.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/apps_helper.h"
#include "chrome/browser/sync/test/integration/apps_sync_test_base.h"
#include "chrome/browser/sync/test/integration/extension_settings_helper.h"
#include "chrome/browser/sync/test/integration/extensions_helper.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/sync/base/features.h"
#include "components/sync/service/sync_service_impl.h"
#include "content/public/test/browser_test.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#endif
namespace {
InstallHostedAppForAllProfiles;
AllExtensionSettingsSameAsVerifier;
SetExtensionSettings;
SetExtensionSettingsForAllProfiles;
InstallExtensionForAllProfiles;
test;
void MutateSomeSettings(
int seed,
const std::string& extension0,
const std::string& extension1,
const std::string& extension2) { … }
class TwoClientAppSettingsSyncTest
: public AppsSyncTestBase { … };
testing::AssertionResult StartWithSameSettingsTest(
const std::string& extension0,
const std::string& extension1,
const std::string& extension2) { … }
testing::AssertionResult StartWithDifferentSettingsTest(
const std::string& extension0,
const std::string& extension1,
const std::string& extension2) { … }
IN_PROC_BROWSER_TEST_F(TwoClientAppSettingsSyncTest,
AppsStartWithSameSettings) { … }
IN_PROC_BROWSER_TEST_F(TwoClientAppSettingsSyncTest,
AppsStartWithDifferentSettings) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
class TwoClientAppSettingsOsSyncTest : public SyncTest {
public:
TwoClientAppSettingsOsSyncTest() : SyncTest(TWO_CLIENT) {}
~TwoClientAppSettingsOsSyncTest() override = default;
bool UseVerifier() override {
return true;
}
};
IN_PROC_BROWSER_TEST_F(TwoClientAppSettingsOsSyncTest,
AppsStartWithSameSettings) {
ASSERT_TRUE(SetupClients());
ASSERT_PRED3(StartWithSameSettingsTest, InstallHostedAppForAllProfiles(0),
InstallHostedAppForAllProfiles(1),
InstallHostedAppForAllProfiles(2));
}
IN_PROC_BROWSER_TEST_F(TwoClientAppSettingsOsSyncTest,
AppsStartWithDifferentSettings) {
ASSERT_TRUE(SetupClients());
ASSERT_PRED3(
StartWithDifferentSettingsTest, InstallHostedAppForAllProfiles(0),
InstallHostedAppForAllProfiles(1), InstallHostedAppForAllProfiles(2));
}
#endif
}