#include "net/dns/serial_worker.h"
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/current_thread.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/backoff_entry.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
constexpr base::TimeDelta kBackoffInitialDelay = …;
constexpr int kBackoffMultiplyFactor = …;
constexpr int kMaxRetries = …;
static const BackoffEntry::Policy kTestBackoffPolicy = …;
class SerialWorkerTest : public TestWithTaskEnvironment { … };
TEST_F(SerialWorkerTest, RunWorkMultipleTimes) { … }
TEST_F(SerialWorkerTest, TriggerTwoTimesBeforeRun) { … }
TEST_F(SerialWorkerTest, TriggerThreeTimesBeforeRun) { … }
TEST_F(SerialWorkerTest, DelayFollowupCompletion) { … }
TEST_F(SerialWorkerTest, RetriggerDuringRun) { … }
TEST_F(SerialWorkerTest, RetriggerDuringFollowup) { … }
TEST_F(SerialWorkerTest, CancelDuringWork) { … }
TEST_F(SerialWorkerTest, CancelDuringFollowup) { … }
TEST_F(SerialWorkerTest, DeleteDuringWork) { … }
TEST_F(SerialWorkerTest, DeleteDuringFollowup) { … }
TEST_F(SerialWorkerTest, RetryAndThenSucceed) { … }
TEST_F(SerialWorkerTest, ExternalWorkRequestResetsRetryState) { … }
TEST_F(SerialWorkerTest, MultipleFailureExponentialBackoff) { … }
}
}