#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/test/mock_callback.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/sharing/sharing_message_bridge_factory.h"
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/sharing_message/features.h"
#include "components/sharing_message/sharing_message_bridge.h"
#include "components/sync/service/sync_token_status.h"
#include "components/sync/test/fake_server_http_post_provider.h"
#include "content/public/test/browser_test.h"
namespace {
SharingMessageSpecifics;
constexpr char kEmptyOAuth2Token[] = …;
constexpr char kInvalidGrantOAuth2Token[] = …;
constexpr char kValidOAuth2Token[] = …;
MATCHER_P(HasErrorCode, expected_error_code, "") { … }
class NextCycleIterationChecker : public SingleClientStatusChangeChecker { … };
class DisabledSharingMessageChecker : public SingleClientStatusChangeChecker { … };
class RetryingAccessTokenFetchChecker : public SingleClientStatusChangeChecker { … };
class SharingMessageEqualityChecker : public SingleClientStatusChangeChecker { … };
class SharingMessageCallbackChecker : public SingleClientStatusChangeChecker { … };
class SingleClientSharingMessageSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest, ShouldSubmit) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
ShouldSubmitInTransportMode) { … }
#endif
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
ShouldPropagateCommitFailure) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
ShouldCleanPendingMessagesUponSignout) { … }
#endif
IN_PROC_BROWSER_TEST_F(
SingleClientSharingMessageSyncTest,
ShouldTurnOffSharingMessageDataTypeOnPersistentAuthError) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientSharingMessageSyncTest,
ShouldRetrySendingSharingMessageDataTypeOnTransientAuthError) { … }
}