#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 { … };
}
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) { … }
TEST_F(ThumbnailImageTest, UnsubscribeAfterDelegateDestroyed) { … }
TEST_F(ThumbnailImageTest, DoesNotCropBlankThumbnails) { … }