#include "components/affiliations/core/browser/affiliation_fetch_throttler.h"
#include <stddef.h>
#include <stdint.h>
#include <cmath>
#include <memory>
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/safe_math.h"
#include "base/test/task_environment.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "components/affiliations/core/browser/affiliation_fetch_throttler_delegate.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace affiliations {
namespace {
class MockAffiliationFetchThrottlerDelegate
: public AffiliationFetchThrottlerDelegate { … };
}
class AffiliationFetchThrottlerTest : public testing::Test { … };
TEST_F(AffiliationFetchThrottlerTest, SuccessfulRequests) { … }
TEST_F(AffiliationFetchThrottlerTest, FailedRequests) { … }
TEST_F(AffiliationFetchThrottlerTest, OnCanSendNetworkRequestReturnsFalse) { … }
TEST_F(AffiliationFetchThrottlerTest, GracePeriodAfterConnectivityIsRestored) { … }
TEST_F(AffiliationFetchThrottlerTest, GracePeriodAfterConnectivityIsRestored2) { … }
TEST_F(AffiliationFetchThrottlerTest, ConnectivityLostDuringBackoff) { … }
TEST_F(AffiliationFetchThrottlerTest,
ConnectivityLostAndRestoredDuringBackoff) { … }
TEST_F(AffiliationFetchThrottlerTest, FlakyConnectivity) { … }
TEST_F(AffiliationFetchThrottlerTest, ConnectivityLostDuringRequest) { … }
TEST_F(AffiliationFetchThrottlerTest,
ConnectivityLostAndRestoredDuringRequest) { … }
TEST_F(AffiliationFetchThrottlerTest,
ConnectivityLostAndRestoredDuringRequest2) { … }
TEST_F(AffiliationFetchThrottlerTest, InstanceDestroyedWhileInBackoff) { … }
}