chromium/chrome/browser/sync/sync_startup_tracker.h

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

#ifndef CHROME_BROWSER_SYNC_SYNC_STARTUP_TRACKER_H_
#define CHROME_BROWSER_SYNC_SYNC_STARTUP_TRACKER_H_

#include <optional>

#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_service_observer.h"

// `SyncStartupTracker` provides an easier way to wait for `SyncService` to be
// successfully started up, or to be notified when startup has failed due to
// some kind of error.
class SyncStartupTracker : public syncer::SyncServiceObserver {};

namespace testing {
// Helper to control `SyncStartupTracker`'s timeout mechanism for tests. If it
// is created with an empty timeout value, it will make the tracker not report
// timeouts.
class ScopedSyncStartupTimeoutOverride {};
}  // namespace testing

#endif  // CHROME_BROWSER_SYNC_SYNC_STARTUP_TRACKER_H_