#include "net/nqe/throughput_analyzer.h"
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/circular_deque.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "net/base/features.h"
#include "net/base/isolation_info.h"
#include "net/base/schemeful_site.h"
#include "net/dns/mock_host_resolver.h"
#include "net/nqe/network_quality_estimator.h"
#include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/network_quality_estimator_test_util.h"
#include "net/nqe/network_quality_estimator_util.h"
#include "net/test/test_with_task_environment.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace net::nqe {
namespace {
std::unique_ptr<HostResolver> CreateMockHostResolver() { … }
class TestThroughputAnalyzer : public internal::ThroughputAnalyzer { … };
ThroughputAnalyzerTest;
TEST_F(ThroughputAnalyzerTest, PrivateHost) { … }
#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID)
#define MAYBE_MaximumRequests …
#else
#define MAYBE_MaximumRequests …
#endif
TEST_F(ThroughputAnalyzerTest, MAYBE_MaximumRequests) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_MaximumRequestsWithNetworkAnonymizationKey …
#else
#define MAYBE_MaximumRequestsWithNetworkAnonymizationKey …
#endif
TEST_F(ThroughputAnalyzerTest,
MAYBE_MaximumRequestsWithNetworkAnonymizationKey) { … }
TEST_F(ThroughputAnalyzerTest, TestMinRequestsForThroughputSample) { … }
TEST_F(ThroughputAnalyzerTest, TestHangingRequests) { … }
TEST_F(ThroughputAnalyzerTest, TestHangingRequestsCheckedOnlyPeriodically) { … }
TEST_F(ThroughputAnalyzerTest, TestLastReceivedTimeIsUpdated) { … }
TEST_F(ThroughputAnalyzerTest, TestRequestDeletedImmediately) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_TestThroughputWithMultipleRequestsOverlap …
#else
#define MAYBE_TestThroughputWithMultipleRequestsOverlap …
#endif
TEST_F(ThroughputAnalyzerTest,
MAYBE_TestThroughputWithMultipleRequestsOverlap) { … }
TEST_F(ThroughputAnalyzerTest, TestThroughputWithNetworkRequestsOverlap) { … }
TEST_F(ThroughputAnalyzerTest, TestThroughputWithMultipleNetworkRequests) { … }
TEST_F(ThroughputAnalyzerTest, TestHangingWindow) { … }
}
}