chromium/cc/tiles/image_controller_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 "cc/tiles/image_controller.h"

#include <memory>
#include <optional>
#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/synchronization/condition_variable.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/threading/simple_thread.h"
#include "base/threading/thread_checker_impl.h"
#include "base/threading/thread_restrictions.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/test/cc_test_suite.h"
#include "cc/test/skia_common.h"
#include "cc/test/stub_decode_cache.h"
#include "cc/test/test_paint_worklet_input.h"
#include "cc/tiles/image_decode_cache.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cc {
namespace {

// Image decode cache with introspection!
class TestableCache : public StubDecodeCache {};

// A simple class that can receive decode callbacks.
class DecodeClient {};

// A dummy task that does nothing.
class SimpleTask : public TileTask {};

// A task that blocks until instructed otherwise.
class BlockingTask : public TileTask {};

// For tests that exercise image controller's thread, this is the timeout value
// to allow the worker thread to do its work.
int kDefaultTimeoutSeconds =;

DrawImage CreateDiscardableDrawImage(gfx::Size size) {}

DrawImage CreateBitmapDrawImage(gfx::Size size) {}

class ImageControllerTest : public testing::Test {};

TEST_F(ImageControllerTest, NullControllerUnrefsImages) {}

TEST_F(ImageControllerTest, QueueImageDecode) {}

TEST_F(ImageControllerTest, QueueImageDecodeNonLazy) {}

TEST_F(ImageControllerTest, QueueImageDecodeTooLarge) {}

TEST_F(ImageControllerTest, QueueImageDecodeMultipleImages) {}

TEST_F(ImageControllerTest, QueueImageDecodeWithTask) {}

TEST_F(ImageControllerTest, QueueImageDecodeMultipleImagesSameTask) {}

TEST_F(ImageControllerTest, QueueImageDecodeChangeControllerWithTaskQueued) {}

TEST_F(ImageControllerTest, QueueImageDecodeImageAlreadyLocked) {}

TEST_F(ImageControllerTest, QueueImageDecodeLockedImageControllerChange) {}

TEST_F(ImageControllerTest, DispatchesDecodeCallbacksAfterCacheReset) {}

TEST_F(ImageControllerTest, DispatchesDecodeCallbacksAfterCacheChanged) {}

TEST_F(ImageControllerTest, QueueImageDecodeLazyCancelImmediately) {}

TEST_F(ImageControllerTest, QueueImageDecodeNonLazyCancelImmediately) {}

}  // namespace
}  // namespace cc