#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/graphics/bitmap_image.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/numerics/safe_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "cc/paint/image_provider.h"
#include "cc/paint/skia_paint_canvas.h"
#include "cc/tiles/mipmap_util.h"
#include "media/media_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h"
#include "third_party/blink/renderer/platform/graphics/deferred_image_decoder.h"
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
#include "third_party/blink/renderer/platform/graphics/test/mock_image_decoder.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
namespace {
class FrameSettingImageProvider : public cc::ImageProvider { … };
void GenerateBitmapForPaintImage(cc::PaintImage paint_image,
size_t frame_index,
cc::PaintImage::GeneratorClientId client_id,
SkBitmap* bitmap) { … }
}
class TestingPlatformSupportWithMaxDecodedBytes
: public TestingPlatformSupportWithMockScheduler { … };
class BitmapImageTest : public testing::Test { … };
TEST_F(BitmapImageTest, destroyDecodedData) { … }
TEST_F(BitmapImageTest, maybeAnimated) { … }
TEST_F(BitmapImageTest, isAllDataReceived) { … }
TEST_F(BitmapImageTest, noColorProfile) { … }
TEST_F(BitmapImageTest, jpegHasColorProfile) { … }
TEST_F(BitmapImageTest, pngHasColorProfile) { … }
TEST_F(BitmapImageTest, webpHasColorProfile) { … }
TEST_F(BitmapImageTest, icoHasWrongFrameDimensions) { … }
TEST_F(BitmapImageTest, correctDecodedDataSize) { … }
TEST_F(BitmapImageTest, recachingFrameAfterDataChanged) { … }
TEST_F(BitmapImageTest, ConstantImageIdForPartiallyLoadedImages) { … }
TEST_F(BitmapImageTest, ImageForDefaultFrame_MultiFrame) { … }
TEST_F(BitmapImageTest, ImageForDefaultFrame_SingleFrame) { … }
TEST_F(BitmapImageTest, GifDecoderFrame0) { … }
TEST_F(BitmapImageTest, GifDecoderFrame1) { … }
TEST_F(BitmapImageTest, GifDecoderFrame2) { … }
TEST_F(BitmapImageTest, GifDecoderFrame3) { … }
TEST_F(BitmapImageTest, GifDecoderMultiThreaded) { … }
TEST_F(BitmapImageTest, APNGDecoder00) { … }
TEST_F(BitmapImageTest, APNGDecoder01) { … }
TEST_F(BitmapImageTest, APNGDecoder02) { … }
TEST_F(BitmapImageTest, APNGDecoder04) { … }
TEST_F(BitmapImageTest, APNGDecoder08) { … }
TEST_F(BitmapImageTest, APNGDecoder10) { … }
TEST_F(BitmapImageTest, APNGDecoder11) { … }
TEST_F(BitmapImageTest, APNGDecoder12) { … }
TEST_F(BitmapImageTest, APNGDecoder14) { … }
TEST_F(BitmapImageTest, APNGDecoder18) { … }
TEST_F(BitmapImageTest, APNGDecoder19) { … }
TEST_F(BitmapImageTest, APNGDecoderDisposePrevious) { … }
TEST_F(BitmapImageTest, GIFRepetitionCount) { … }
TEST_F(BitmapImageTest, DecoderAndCacheMipLevels) { … }
class BitmapImageTestWithMockDecoder : public BitmapImageTest,
public MockImageDecoderClient { … };
TEST_F(BitmapImageTestWithMockDecoder, ImageMetadataTracking) { … }
TEST_F(BitmapImageTestWithMockDecoder,
AnimationPolicyOverrideOriginalRepetitionNone) { … }
TEST_F(BitmapImageTestWithMockDecoder,
AnimationPolicyOverrideOriginalRepetitionOnce) { … }
TEST_F(BitmapImageTestWithMockDecoder,
AnimationPolicyOverrideOriginalRepetitionInfinite) { … }
TEST_F(BitmapImageTestWithMockDecoder, ResetAnimation) { … }
TEST_F(BitmapImageTestWithMockDecoder, PaintImageForStaticBitmapImage) { … }
class BitmapHistogramTest : public BitmapImageTest { … };
TEST_F(BitmapHistogramTest, DecodedImageType) { … }
TEST_F(BitmapHistogramTest, DecodedImageDensityKiBWeighted) { … }
}