// Copyright 2016 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40284755): Remove this and spanify to fix the errors. #pragma allow_unsafe_buffers #endif #include "net/nqe/observation_buffer.h" #include <stddef.h> #include <map> #include <string> #include <utility> #include <vector> #include "base/test/simple_test_tick_clock.h" #include "base/time/time.h" #include "net/nqe/network_quality_estimator_params.h" #include "net/nqe/network_quality_observation.h" #include "net/nqe/network_quality_observation_source.h" #include "testing/gtest/include/gtest/gtest.h" namespace net::nqe::internal { namespace { // Verify that the buffer size is never exceeded. TEST(NetworkQualityObservationBufferTest, BoundedBuffer) { … } // Verify that the percentiles are monotonically non-decreasing when a weight is // applied. TEST(NetworkQualityObservationBufferTest, GetPercentileWithWeights) { … } // Verifies that the percentiles are correctly computed. All observations have // the same timestamp. TEST(NetworkQualityObservationBufferTest, PercentileSameTimestamps) { … } // Verifies that the percentiles are correctly computed. Observations have // different timestamps with half the observations being very old and the rest // of them being very recent. Percentiles should factor in recent observations // much more heavily than older samples. TEST(NetworkQualityObservationBufferTest, PercentileDifferentTimestamps) { … } // Verifies that the percentiles are correctly computed. All observations have // same timestamp with half the observations taken at low RSSI, and half the // observations with high RSSI. Percentiles should be computed based on the // current RSSI and the RSSI of the observations. TEST(NetworkQualityObservationBufferTest, PercentileDifferentRSSI) { … } // Verifies that the percentiles are correctly computed when some of the // observation sources are disallowed. All observations have the same timestamp. TEST(NetworkQualityObservationBufferTest, RemoveObservations) { … } TEST(NetworkQualityObservationBufferTest, TestGetMedianRTTSince) { … } } // namespace } // namespace net::nqe::internal