#include "components/offline_pages/core/background/request_queue.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_mock_time_task_runner.h"
#include "components/offline_pages/core/background/device_conditions.h"
#include "components/offline_pages/core/background/offliner_policy.h"
#include "components/offline_pages/core/background/request_coordinator.h"
#include "components/offline_pages/core/background/request_coordinator_event_logger.h"
#include "components/offline_pages/core/background/request_notifier.h"
#include "components/offline_pages/core/background/request_queue_store.h"
#include "components/offline_pages/core/background/save_page_request.h"
#include "components/offline_pages/core/background/test_request_queue_store.h"
#include "components/offline_pages/core/offline_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace offline_pages {
AddRequestResult;
GetRequestsResult;
UpdateRequestResult;
namespace {
const int64_t kRequestId = …;
const ClientId kClientId("bookmark", "1234");
const int64_t kRequestId2 = …;
const ClientId kClientId2("bookmark", "567");
const bool kUserRequested = …;
const int64_t kRequestId3 = …;
const int kOneWeekInSeconds = …;
SavePageRequest EmptyRequest() { … }
}
class RequestNotifierStub : public RequestNotifier { … };
class RequestQueueTest : public testing::Test { … };
RequestQueueTest::RequestQueueTest()
: … { … }
RequestQueueTest::~RequestQueueTest() { … }
void RequestQueueTest::SetUp() { … }
void RequestQueueTest::PumpLoop() { … }
void RequestQueueTest::AddRequestDone(AddRequestResult result,
const SavePageRequest& request) { … }
void RequestQueueTest::GetRequestsDone(
GetRequestsResult result,
std::vector<std::unique_ptr<SavePageRequest>> requests) { … }
void RequestQueueTest::UpdateRequestDone(UpdateRequestResult result) { … }
void RequestQueueTest::UpdateRequestsDone(UpdateRequestsResult result) { … }
void RequestQueueTest::ClearResults() { … }
TEST_F(RequestQueueTest, GetRequestsEmpty) { … }
TEST_F(RequestQueueTest, AddRequest) { … }
TEST_F(RequestQueueTest, RemoveRequest) { … }
TEST_F(RequestQueueTest, RemoveSeveralRequests) { … }
TEST_F(RequestQueueTest, PauseAndResume) { … }
TEST_F(RequestQueueTest, MultipleRequestsAddGetRemove) { … }
TEST_F(RequestQueueTest, MarkAttemptStarted) { … }
TEST_F(RequestQueueTest, MarkAttempStartedRequestNotPresent) { … }
TEST_F(RequestQueueTest, MarkAttemptAborted) { … }
TEST_F(RequestQueueTest, MarkAttemptAbortedRequestNotPresent) { … }
TEST_F(RequestQueueTest, MarkAttemptCompleted) { … }
TEST_F(RequestQueueTest, CleanStaleRequests) { … }
}