chromium/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {};

// Waits until all expected sharing messages are successfully committed. Sharing
// messages are equal if they have the same payload.
class SharingMessageEqualityChecker : public SingleClientStatusChangeChecker {};

// Waits for the sharing message callback with expected error code to be called.
// The provided callback must be called only once.
class SharingMessageCallbackChecker : public SingleClientStatusChangeChecker {};

class SingleClientSharingMessageSyncTest : public SyncTest {};

IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest, ShouldSubmit) {}

// ChromeOS does not support late signin after profile creation, so the test
// below does not apply, at least in the current form.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
                       ShouldSubmitInTransportMode) {}
#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)

IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
                       ShouldPropagateCommitFailure) {}

// ChromeOS does not support signing out of a primary account.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientSharingMessageSyncTest,
                       ShouldCleanPendingMessagesUponSignout) {}
#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)

IN_PROC_BROWSER_TEST_F(
    SingleClientSharingMessageSyncTest,
    ShouldTurnOffSharingMessageDataTypeOnPersistentAuthError) {}

IN_PROC_BROWSER_TEST_F(
    SingleClientSharingMessageSyncTest,
    ShouldRetrySendingSharingMessageDataTypeOnTransientAuthError) {}

}  // namespace