chromium/chrome/browser/apps/icon_standardizer_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/browser/apps/icon_standardizer.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"

namespace {

constexpr int kIconSize =;

constexpr float kMaxCircleIconSize =;
constexpr float kStandardCircleRadius =;

// Returns whether the bitmaps are equal.
bool AreBitmapsEqual(const SkBitmap& first_bitmap,
                     const SkBitmap& second_bitmap) {}

bool DoesIconHaveWhiteBackgroundCircle(const SkBitmap& bitmap) {}

}  // namespace

CreateStandardIconTest;

// Test that a square icon gets scaled down and drawn on top of a circular
// background when converted to a standard icon.
TEST_F(CreateStandardIconTest, SquareIconToStandardIcon) {}

// Test that a large circular icon gets scaled down when converted to a standard
// icon.
TEST_F(CreateStandardIconTest, CircularIconToStandardIcon) {}

// Test that a circle icon that is already standard size, keeps the same size
// when standardized.
TEST_F(CreateStandardIconTest, StandardCircularIconToStandardIcon) {}

// Test that a circle icon that has an extra opaque area near the outside of the
// circle will have a background circle added when standardized.
TEST_F(CreateStandardIconTest, AlmostCircularIconToStandardIcon) {}