chromium/components/offline_pages/core/background/request_queue_unittest.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Data for request 1.
const int64_t kRequestId =;
const ClientId kClientId("bookmark", "1234");
// Data for request 2.
const int64_t kRequestId2 =;
const ClientId kClientId2("bookmark", "567");
const bool kUserRequested =;
const int64_t kRequestId3 =;
const int kOneWeekInSeconds =;

// Default request
SavePageRequest EmptyRequest() {}

}  // namespace

// Helper class needed by the PickRequestTask
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) {}

// A longer test populating the request queue with more than one item, properly
// listing multiple items and removing the right item.
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) {}

}  // namespace offline_pages