#include "net/http/broken_alternative_services.h"
#include <algorithm>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/schemeful_site.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace net {
namespace {
const uint64_t kBrokenAlternativeProtocolDelaySecs = …;
class BrokenAlternativeServicesTest
: public BrokenAlternativeServices::Delegate,
public ::testing::Test { … };
TEST_F(BrokenAlternativeServicesTest, MarkBroken) { … }
TEST_F(BrokenAlternativeServicesTest, MarkBrokenUntilDefaultNetworkChanges) { … }
TEST_F(BrokenAlternativeServicesTest, MarkRecentlyBroken) { … }
TEST_F(BrokenAlternativeServicesTest, OnDefaultNetworkChanged) { … }
TEST_F(BrokenAlternativeServicesTest,
ExpireBrokenAlternativeServiceOnDefaultNetwork) { … }
TEST_F(BrokenAlternativeServicesTest, ExpireBrokenAlternateProtocolMappings) { … }
TEST_F(BrokenAlternativeServicesTest, IsBroken) { … }
TEST_F(BrokenAlternativeServicesTest, BrokenAfterBrokenOnDefaultNetwork) { … }
TEST_F(BrokenAlternativeServicesTest, BrokenOnDefaultNetworkAfterBroken) { … }
TEST_F(BrokenAlternativeServicesTest,
BrokenUntilDefaultNetworkChangeWithExponentialBackoff) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff) { … }
void BrokenAlternativeServicesTest::TestExponentialBackoff(
base::TimeDelta initial_delay,
bool exponential_backoff_on_initial_delay) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_OneSecond_True) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_OneSecond_False) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_FiveSeconds_True) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_FiveSeconds_False) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_TenSeconds_True) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_TenSeconds_False) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_FiveMinutes_True) { … }
TEST_F(BrokenAlternativeServicesTest, ExponentialBackoff_FiveMinutes_False) { … }
TEST_F(BrokenAlternativeServicesTest, RemoveExpiredBrokenAltSvc) { … }
TEST_F(BrokenAlternativeServicesTest,
RemoveExpiredBrokenAltSvcWithNetworkAnonymizationKey) { … }
TEST_F(BrokenAlternativeServicesTest, SetBrokenAlternativeServices) { … }
TEST_F(BrokenAlternativeServicesTest,
SetBrokenAlternativeServicesWithExisting) { … }
TEST_F(BrokenAlternativeServicesTest, ScheduleExpireTaskAfterExpire) { … }
TEST_F(BrokenAlternativeServicesTest, Clear) { … }
}
}