blob: b7e1052d5bcc9b0f108b88d8e5ccd9715a4087e8 [file] [log] [blame]
danakj99437fc2021-03-05 21:27:041// Copyright 2021 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/gfx/image/image_skia_operations.h"
6
7#include "testing/gtest/include/gtest/gtest.h"
David Sanders03ee601f2022-02-22 02:23:008#include "ui/gfx/geometry/size.h"
danakj99437fc2021-03-05 21:27:049#include "ui/gfx/image/image_skia.h"
David Sanders03ee601f2022-02-22 02:23:0010#include "ui/gfx/image/image_skia_rep.h"
danakj99437fc2021-03-05 21:27:0411
12namespace gfx {
13namespace {
14
15TEST(ImageSkiaOperationsTest, ResizeFailure) {
16 ImageSkia image(ImageSkiaRep(gfx::Size(10, 10), 1.f));
17
18 // Try to resize to empty. This isn't a valid resize and fails gracefully.
19 ImageSkia resized = ImageSkiaOperations::CreateResizedImage(
20 image, skia::ImageOperations::RESIZE_BEST, gfx::Size());
21 EXPECT_TRUE(resized.GetRepresentation(1.0f).is_null());
22}
23
24} // namespace
25} // namespace gfx