chromium/components/page_image_service/image_service_consent_helper_unittest.cc

// Copyright 2023 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/page_image_service/image_service_consent_helper.h"

#include <memory>

#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "components/page_image_service/metrics_util.h"
#include "components/page_image_service/mojom/page_image_service.mojom-shared.h"
#include "components/sync/test/test_sync_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace page_image_service {
namespace {

ElementsAre;

class ImageServiceConsentHelperTest : public testing::Test {};

TEST_F(ImageServiceConsentHelperTest, EnabledAndDisabledRunSynchronously) {}

TEST_F(ImageServiceConsentHelperTest, ExpireOldRequests) {}

TEST_F(ImageServiceConsentHelperTest, InitializationFulfillsAllQueuedRequests) {}

TEST_F(ImageServiceConsentHelperTest, InitializationDisabledCase) {}

// In production, sometimes the callback to a request enqueues a new request.
// This tests this case and fixes the crash in https://crbug.com/1472360.
TEST_F(ImageServiceConsentHelperTest, CallbacksMakingNewRequests) {}

}  // namespace
}  // namespace page_image_service