#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/uuid.h"
#include "chrome/browser/sync/test/integration/saved_tab_groups_helper.h"
#include "chrome/browser/sync/test/integration/shared_tab_group_data_helper.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/data_sharing/public/features.h"
#include "components/saved_tab_groups/saved_tab_group.h"
#include "components/saved_tab_groups/saved_tab_group_model.h"
#include "components/saved_tab_groups/saved_tab_group_tab.h"
#include "components/saved_tab_groups/saved_tab_group_test_utils.h"
#include "components/saved_tab_groups/tab_group_sync_service.h"
#include "components/saved_tab_groups/types.h"
#include "components/sync/base/data_type.h"
#include "components/sync/protocol/saved_tab_group_specifics.pb.h"
#include "components/sync/protocol/shared_tab_group_data_specifics.pb.h"
#include "components/sync/service/sync_service_impl.h"
#include "content/public/test/browser_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/tab_group_sync/tab_group_sync_service_factory.h"
#else
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#endif
namespace tab_groups {
namespace {
SizeIs;
UnorderedElementsAre;
MATCHER_P3(HasSharedGroupMetadata, title, color, collaboration_id, "") { … }
MATCHER_P2(HasTabMetadata, title, url, "") { … }
sync_pb::SharedTabGroupDataSpecifics MakeSharedTabGroupSpecifics(
const base::Uuid& guid,
const std::string& title,
sync_pb::SharedTabGroup::Color color) { … }
sync_pb::SharedTabGroupDataSpecifics MakeSharedTabGroupTabSpecifics(
const base::Uuid& guid,
const base::Uuid& group_guid,
const std::string& title,
const GURL& url) { … }
class SingleClientSharedTabGroupDataSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientSharedTabGroupDataSyncTest,
ShouldInitializeDataType) { … }
IN_PROC_BROWSER_TEST_F(SingleClientSharedTabGroupDataSyncTest,
ShouldDownloadGroupsAndTabsAtInitialSync) { … }
IN_PROC_BROWSER_TEST_F(SingleClientSharedTabGroupDataSyncTest,
ShouldTransitionSavedToSharedTabGroup) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SingleClientSharedTabGroupDataSyncTest,
PRE_ShouldReloadDataOnBrowserRestart) { … }
IN_PROC_BROWSER_TEST_F(SingleClientSharedTabGroupDataSyncTest,
ShouldReloadDataOnBrowserRestart) { … }
#endif
}
}