#include "services/network/ip_protection/ip_protection_config_cache_impl.h"
#include <deque>
#include <map>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/ip_protection/common/ip_protection_data_types.h"
#include "net/base/features.h"
#include "net/base/network_change_notifier.h"
#include "services/network/ip_protection/ip_protection_geo_utils.h"
#include "services/network/ip_protection/ip_protection_proxy_list_manager.h"
#include "services/network/ip_protection/ip_protection_proxy_list_manager_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace network {
namespace {
constexpr char kEmptyTokenCacheHistogram[] = …;
constexpr char kMountainViewGeoId[] = …;
constexpr char kSunnyvaleGeoId[] = …;
constexpr bool kEnableTokenCacheByGeo = …;
constexpr bool kDisableTokenCacheByGeo = …;
class MockIpProtectionTokenCacheManager : public IpProtectionTokenCacheManager { … };
class MockIpProtectionProxyListManager : public IpProtectionProxyListManager { … };
class IpProtectionConfigCacheImplTest : public testing::Test { … };
TEST_F(IpProtectionConfigCacheImplTest,
AreAuthTokensAvailable_NoProxiesConfigured) { … }
TEST_F(IpProtectionConfigCacheImplTest,
AuthTokensNotAvailableIfProxyListIsNotAvailable) { … }
TEST_F(IpProtectionConfigCacheImplTest, GetAuthTokenFromManagerForProxyA) { … }
TEST_F(IpProtectionConfigCacheImplTest, GetAuthTokenFromManagerForProxyB) { … }
TEST_F(IpProtectionConfigCacheImplTest,
AreAuthTokensAvailable_OneTokenCacheIsEmpty) { … }
TEST_F(IpProtectionConfigCacheImplTest, GetAuthTokenForOldGeo) { … }
TEST_F(IpProtectionConfigCacheImplTest, GetProxyListFromManager) { … }
TEST_F(IpProtectionConfigCacheImplTest, GetProxyListFromManagerWithQuic) { … }
TEST_F(IpProtectionConfigCacheImplTest, RefreshProxyListOnNetworkChange) { … }
TEST_F(IpProtectionConfigCacheImplTest,
GeoChangeObservedInIppProxyListManager) { … }
TEST_F(IpProtectionConfigCacheImplTest,
GeoChangeObservedEmptyGeoIdInProxyListManager) { … }
TEST_F(IpProtectionConfigCacheImplTest,
GeoObservedTokenCachingByGeoDisabledNoImpact) { … }
TEST_F(IpProtectionConfigCacheImplTest,
GeoChangeObservedInIppTokenCacheManager) { … }
}
}