chromium/third_party/openscreen/src/cast/streaming/impl/clock_offset_estimator_impl_unittest.cc

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

#include "cast/streaming/impl/clock_offset_estimator_impl.h"

#include <stdint.h>

#include <memory>
#include <utility>

#include "gtest/gtest.h"
#include "platform/base/trivial_clock_traits.h"
#include "platform/test/fake_clock.h"
#include "util/chrono_helpers.h"

namespace openscreen::cast {

class ClockOffsetEstimatorImplTest : public ::testing::Test {};

// Suppose the true offset is 100ms.
// Event A occurred at sender time 20ms.
// Event B occurred at receiver time 130ms. (sender time 30ms)
// Event C occurred at sender time 60ms.
// Then the bound after all 3 events have arrived is [130-60=70, 130-20=110].
TEST_F(ClockOffsetEstimatorImplTest, EstimateOffset) {}

// Same scenario as above, but event C arrives before event B. It doesn't mean
// event C occurred before event B.
TEST_F(ClockOffsetEstimatorImplTest, EventCArrivesBeforeEventB) {}

TEST_F(ClockOffsetEstimatorImplTest, MultipleIterations) {}

}  // namespace openscreen::cast