#include "chrome/browser/predictors/preconnect_manager.h"
#include <map>
#include <utility>
#include "base/format_macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/predictors/loading_test_util.h"
#include "chrome/browser/predictors/predictors_features.h"
#include "chrome/browser/predictors/proxy_lookup_client_impl.h"
#include "chrome/browser/predictors/resolve_host_client_impl.h"
#include "chrome/browser/preloading/preloading_prefs.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/browser_task_environment.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/load_flags.h"
#include "net/base/network_anonymization_key.h"
#include "net/dns/public/resolve_error_info.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/test/test_network_context.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
_;
Mock;
SaveArg;
StrictMock;
namespace predictors {
namespace {
net::ProxyInfo GetIndirectProxyInfo() { … }
net::ProxyInfo GetDirectProxyInfo() { … }
class MockPreconnectManagerDelegate : public PreconnectManager::Delegate { … };
class MockNetworkContext : public network::TestNetworkContext { … };
net::NetworkAnonymizationKey CreateNetworkAnonymizationKey(
const GURL& main_frame_url) { … }
}
class PreconnectManagerTest : public testing::Test { … };
PreconnectManagerTest::PreconnectManagerTest()
: … { … }
PreconnectManagerTest::~PreconnectManagerTest() { … }
TEST_F(PreconnectManagerTest, TestStartOneUrlPreresolve) { … }
TEST_F(PreconnectManagerTest, TestStartOneUrlPreconnect) { … }
TEST_F(PreconnectManagerTest, TestLimitPreconnectCount) { … }
TEST_F(PreconnectManagerTest,
TestStartOneUrlPreconnectWithNetworkIsolationKey) { … }
TEST_F(PreconnectManagerTest, TestStartOneUrlPreconnect_MultipleTimes) { … }
TEST_F(PreconnectManagerTest, TestTwoConcurrentMainFrameUrls_MultipleTimes) { … }
TEST_F(PreconnectManagerTest,
TestStartOneUrlPreconnect_MultipleTimes_CancelledAfterInFlight) { … }
TEST_F(PreconnectManagerTest,
TestStartOneUrlPreconnect_MultipleTimes_LessThanThree) { … }
TEST_F(PreconnectManagerTest, TestStopOneUrlBeforePreconnect) { … }
TEST_F(PreconnectManagerTest, TestGetCallbackAfterDestruction) { … }
TEST_F(PreconnectManagerTest, TestUnqueuedPreresolvesCanceled) { … }
TEST_F(PreconnectManagerTest, TestQueueingMetricsRecorded) { … }
TEST_F(PreconnectManagerTest, TestTwoConcurrentMainFrameUrls) { … }
TEST_F(PreconnectManagerTest, TestTwoConcurrentSameHostMainFrameUrls) { … }
TEST_F(PreconnectManagerTest, TestStartPreresolveHost) { … }
TEST_F(PreconnectManagerTest, TestStartPreresolveHostDisabledViaUI) { … }
TEST_F(PreconnectManagerTest, TestStartPreresolveHosts) { … }
TEST_F(PreconnectManagerTest, TestStartPreresolveHostsDisabledViaUI) { … }
TEST_F(PreconnectManagerTest, TestStartPreconnectUrl) { … }
TEST_F(PreconnectManagerTest, TestStartPreconnectUrlDisabledViaUI) { … }
TEST_F(PreconnectManagerTest, TestStartPreconnectUrlWithNetworkIsolationKey) { … }
TEST_F(PreconnectManagerTest, TestDetachedRequestHasHigherPriority) { … }
TEST_F(PreconnectManagerTest, TestSuccessfulProxyLookup) { … }
TEST_F(PreconnectManagerTest, TestStartDisabledViaUI) { … }
TEST_F(PreconnectManagerTest, TestSuccessfulHostLookupAfterProxyLookupFailure) { … }
TEST_F(PreconnectManagerTest, TestBothProxyAndHostLookupFailed) { … }
}