chromium/chrome/browser/ui/thumbnails/thumbnail_image_unittest.cc

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

#include "chrome/browser/ui/thumbnails/thumbnail_image.h"

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

#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_unittest_util.h"

namespace {

constexpr int kTestBitmapWidth =;
constexpr int kTestBitmapHeight =;

class CallbackWaiter {};

class StubDelegate : public ThumbnailImage::Delegate {};

}  // anonymous namespace

class ThumbnailImageTest : public testing::Test,
                           public ThumbnailImage::Delegate {};

Subscription;

TEST_F(ThumbnailImageTest, AddRemoveSubscriber) {}

TEST_F(ThumbnailImageTest, AddRemoveMultipleObservers) {}

TEST_F(ThumbnailImageTest, AssignSkBitmapNotifiesObservers) {}

TEST_F(ThumbnailImageTest, AssignSkBitmap_NotifiesObserversAgain) {}

TEST_F(ThumbnailImageTest, AssignSkBitmap_NotifiesCompressedObservers) {}

TEST_F(ThumbnailImageTest, AssignSkBitmap_NotifiesCompressedObserversAgain) {}

TEST_F(ThumbnailImageTest, RequestThumbnailImage) {}

TEST_F(ThumbnailImageTest, RequestCompressedThumbnailData) {}

TEST_F(ThumbnailImageTest, ClearThumbnailAfterAssignBitmap) {}

TEST_F(ThumbnailImageTest, ClearExistingThumbnailNotifiesObservers) {}

// Makes sure a null dereference does not happen. Regression test for
// crbug.com/1159701.
TEST_F(ThumbnailImageTest, UnsubscribeAfterDelegateDestroyed) {}

// Ensures subscribers with a size hint get notified correctly on
// thumbnail clear. Regression test for crbug.com/1168483 where
// CropPreviewImage was called on blank thumbnails resulting in a
// DCHECK.
TEST_F(ThumbnailImageTest, DoesNotCropBlankThumbnails) {}